diff --git a/.gitmodules b/.gitmodules index 089162d33e..c91fdc2811 100644 --- a/.gitmodules +++ b/.gitmodules @@ -286,6 +286,9 @@ [submodule "frozen/Adafruit_CircuitPython_FakeRequests"] path = frozen/Adafruit_CircuitPython_FakeRequests url = https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git +[submodule "frozen/pew-pewpew-lcd"] + path = frozen/pew-pewpew-lcd + url = https://github.com/pypewpew/pew-pewpew-lcd.git [submodule "ports/espressif/boards/mixgo_ce_udisk/cp_lib"] path = ports/espressif/boards/mixgo_ce_udisk/cp_lib - url = https://github.com/dahanzimin/circuitpython_lib.git + url = https://github.com/dahanzimin/circuitpython_lib.git \ No newline at end of file diff --git a/.readthedocs.yml b/.readthedocs.yml index 9743a70494..94ba8750b0 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,16 +9,15 @@ version: 2 build: - os: ubuntu-20.04 - tools: - python: "3" - -submodules: - include: - - extmod/ulab + os: ubuntu-20.04 + tools: + python: "3" + jobs: + post_install: + - python tools/ci_fetch_deps.py docs HEAD formats: - - pdf + - pdf python: install: diff --git a/Makefile b/Makefile index 55a35082b7..b35b5c66b9 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \ help: @echo "Please use \`make ' where is one of" + @echo " fetch-submodules to fetch dependencies from submodules, run this right after you clone the repo" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" diff --git a/conf.py b/conf.py index df468d3d0e..c92e8bb719 100644 --- a/conf.py +++ b/conf.py @@ -53,9 +53,13 @@ subprocess.check_output(["make", "stubs"]) modules_support_matrix = shared_bindings_matrix.support_matrix_by_board() modules_support_matrix_reverse = defaultdict(list) for board, modules in modules_support_matrix.items(): - for module in modules: + for module in modules[0]: modules_support_matrix_reverse[module].append(board) -modules_support_matrix_reverse = dict((module, sorted(boards)) for module, boards in modules_support_matrix_reverse.items()) + +modules_support_matrix_reverse = dict( + (module, sorted(boards)) + for module, boards in modules_support_matrix_reverse.items() +) html_context = { 'support_matrix': modules_support_matrix, diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index d8a222ecfe..a22bcfb082 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -57,6 +57,11 @@ bool vm_used_ble; // } // } +void bleio_user_reset() { + // HCI doesn't support the BLE workflow so just do a full reset. + bleio_reset(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Create a UUID object for all CCCD's. diff --git a/docs/library/builtins.rst b/docs/library/builtins.rst index 8532dc2531..a3be5ae16e 100644 --- a/docs/library/builtins.rst +++ b/docs/library/builtins.rst @@ -4,11 +4,18 @@ All builtin functions and exceptions are described here. They are also available via ``builtins`` module. +For more information about built-ins, see the following CPython documentation: + +* `Builtin CPython Functions `_ +* `Builtin CPython Exceptions `_ +* `Builtin CPython Constants `_ + +.. note:: Not all of these functions, types, exceptions, and constants are turned + on in all CircuitPython ports, for space reasons. + Functions and types ------------------- -Not all of these functions and types are turned on in all CircuitPython ports, for space reasons. - .. function:: abs() .. function:: all() @@ -160,46 +167,77 @@ Not all of these functions and types are turned on in all CircuitPython ports, f Exceptions ---------- +.. exception:: ArithmeticError + .. exception:: AssertionError .. exception:: AttributeError +.. exception:: BaseException + +.. exception:: BrokenPipeError + +.. exception:: ConnectionError + +.. exception:: EOFError + .. exception:: Exception .. exception:: ImportError +.. exception:: IndentationError + .. exception:: IndexError .. exception:: KeyboardInterrupt .. exception:: KeyError +.. exception:: LookupError + .. exception:: MemoryError +.. exception:: MpyError + + Not a part of the CPython standard library + .. exception:: NameError .. exception:: NotImplementedError .. exception:: OSError +.. exception:: OverflowError + .. exception:: RuntimeError .. exception:: ReloadException `ReloadException` is used internally to deal with soft restarts. + Not a part of the CPython standard library + +.. exception:: StopAsyncIteration + .. exception:: StopIteration .. exception:: SyntaxError .. exception:: SystemExit - |see_cpython| :py:class:`cpython:SystemExit`. +.. exception:: TimeoutError .. exception:: TypeError - |see_cpython| :py:class:`cpython:TypeError`. +.. exception:: UnicodeError .. exception:: ValueError .. exception:: ZeroDivisionError + +Constants +--------- + +.. data:: Ellipsis + +.. data:: NotImplemented diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 44554e1ad7..961b38370d 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -62,9 +62,17 @@ additional_modules = { "fontio": "CIRCUITPY_DISPLAYIO", "terminalio": "CIRCUITPY_DISPLAYIO", "adafruit_bus_device": "CIRCUITPY_BUSDEVICE", - "adafruit_pixelbuf": "CIRCUITPY_PIXELBUF" + "adafruit_pixelbuf": "CIRCUITPY_PIXELBUF", + "usb": "CIRCUITPY_USB_HOST", } +frozen_excludes = ["examples", "docs", "tests", "utils", "conf.py", "setup.py"] +"""Files and dirs at the root of a frozen directory that should be ignored. +This is the same list as in the preprocess_frozen_modules script.""" + +repository_urls = {} +"""Cache of repository URLs for frozen modules.""" + def get_circuitpython_root_dir(): """ The path to the root './circuitpython' directory """ @@ -162,6 +170,63 @@ def get_settings_from_makefile(port_dir, board_name): return settings +def get_repository_url(directory): + if directory in repository_urls: + return repository_urls[directory] + readme = None + for readme_path in ( + os.path.join(directory, "README.rst"), + os.path.join(os.path.dirname(directory), "README.rst") + ): + if os.path.exists(readme_path): + readme = readme_path + break + path = None + if readme: + with open(readme, "r") as fp: + for line in fp.readlines(): + if m := re.match("\s+:target:\s+(http\S+(docs.circuitpython|readthedocs)\S+)\s*", line): + path = m.group(1) + break + if m := re.search("<(http[^>]+)>", line): + path = m.group(1) + break + if path is None: + contents = subprocess.run( + ["git", "remote", "get-url", "origin"], + encoding="utf-8", + errors="replace", + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=directory + ) + path = contents.stdout.strip() + repository_urls[directory] = path + return path + +def frozen_modules_from_dirs(frozen_mpy_dirs): + """ + Go through the list of frozen directories and extract the python modules. + Paths are of the type: + $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground + $(TOP)/frozen/circuitpython-stage/meowbit + Python modules are at the root of the path, and are python files or directories + containing python files. Except the ones in the frozen_excludes list. + """ + frozen_modules = [] + for frozen_path in filter(lambda x: x, frozen_mpy_dirs.split(" ")): + source_dir = get_circuitpython_root_dir() / frozen_path[7:] + url_repository = get_repository_url(source_dir) + for sub in source_dir.glob("*"): + if sub.name in frozen_excludes: + continue + if sub.name.endswith(".py"): + frozen_modules.append((sub.name[:-3], url_repository)) + continue + if next(sub.glob("**/*.py"), None): # tests if not empty + frozen_modules.append((sub.name, url_repository)) + return frozen_modules + def lookup_setting(settings, key, default=''): while True: value = settings.get(key, default) @@ -207,8 +272,14 @@ def support_matrix_by_board(use_branded_name=True): board_modules.append(base[module]['name']) board_modules.sort() + frozen_modules = [] + if "FROZEN_MPY_DIRS" in settings: + frozen_modules = frozen_modules_from_dirs(settings["FROZEN_MPY_DIRS"]) + if frozen_modules: + frozen_modules.sort() + # generate alias boards too - board_matrix = [(board_name, board_modules)] + board_matrix = [(board_name, (board_modules, frozen_modules))] if entry.name in aliases_by_board: for alias in aliases_by_board[entry.name]: if use_branded_name: @@ -216,7 +287,7 @@ def support_matrix_by_board(use_branded_name=True): alias = aliases_brand_names[alias] else: alias = alias.replace("_"," ").title() - board_matrix.append( (alias, board_modules) ) + board_matrix.append( (alias, (board_modules, frozen_modules)) ) return board_matrix # this is now a list of (board,modules) @@ -225,7 +296,6 @@ def support_matrix_by_board(use_branded_name=True): # flatmap with comprehensions boards = dict(sorted([board for matrix in mapped_exec for board in matrix])) - # print(json.dumps(boards, indent=2)) return boards if __name__ == '__main__': diff --git a/docs/static/filter.css b/docs/static/filter.css index 12efe14a40..021f850f4b 100644 --- a/docs/static/filter.css +++ b/docs/static/filter.css @@ -7,8 +7,21 @@ right: 10px; top: 4px; } -.support-matrix-table .this_module code, -.support-matrix-table .this_module span { + +.support-matrix-table .reference.external { + box-sizing: border-box; + font-weight: 700; + color: #404040; + font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; + padding: 2px 5px; + background: white; + border: 1px solid #e1e4e5; + font-size: 75%; +} + +.support-matrix-table .this_module, +.support-matrix-table .this_module.reference.external, +.support-matrix-table .this_module * { background: black; color: white; } diff --git a/docs/static/filter.js b/docs/static/filter.js index 9dc46a9eed..034c9cb463 100644 --- a/docs/static/filter.js +++ b/docs/static/filter.js @@ -44,14 +44,14 @@ $(() => { var nvisible = 0; $(".support-matrix-table tbody tr").each( (index,item) => { var name = $(item).find("td:first-child p").html(); - var modules = $(item).find("a.reference.internal"); + var modules = $(item).find("code, a.reference.external"); var matching_all = true; // list_search.forEach((sstring) => { var matching = (sstring[0] == "-"); for(var modi = 0; modi < modules.length; ++modi) { module = modules[modi]; - var mod_name = module.firstChild.firstChild.textContent; + var mod_name = module.firstChild.textContent; if(sstring[0] == "-") { if(mod_name.match(sstring.substr(1))) { matching = false; diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index 2dfd61a0d5..3d1aab0daf 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit 2dfd61a0d5ffc8048e72d24e5ecdac9a74bb2bc3 +Subproject commit 3d1aab0daf63c3b4476f73cba39cf5da49e1e4aa diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x index 742ac7c8fb..2d8310f19d 160000 --- a/frozen/Adafruit_CircuitPython_RFM9x +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -1 +1 @@ -Subproject commit 742ac7c8fb52bb85d9fd367b60a7f80475d7ed14 +Subproject commit 2d8310f19d1bdce817df13e807b409b5b057fc21 diff --git a/frozen/Adafruit_CircuitPython_ST7789 b/frozen/Adafruit_CircuitPython_ST7789 index 5fdd62ab69..850c3dc512 160000 --- a/frozen/Adafruit_CircuitPython_ST7789 +++ b/frozen/Adafruit_CircuitPython_ST7789 @@ -1 +1 @@ -Subproject commit 5fdd62ab69fda70407644acc6f9b45681da9ef68 +Subproject commit 850c3dc512f7feae1eaad20bdc1c5e4c63c92f08 diff --git a/frozen/pew-pewpew-lcd b/frozen/pew-pewpew-lcd new file mode 160000 index 0000000000..837f3e5f16 --- /dev/null +++ b/frozen/pew-pewpew-lcd @@ -0,0 +1 @@ +Subproject commit 837f3e5f16accae5b3677954921b5ddd517f0799 diff --git a/locale/ID.po b/locale/ID.po index b3dd782f1e..c16258bf52 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -113,6 +113,10 @@ msgstr "%q panjang harus >= 1" msgid "%q must be %d-%d" msgstr "%q harus %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q harus <= %d" @@ -1768,6 +1772,10 @@ msgstr "Tidak ada pull-down pada pin; 1Mohm direkomendasikan" msgid "No space left on device" msgstr "Tidak ada ruang yang tersisa di perangkat" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Tidak ada file/direktori" @@ -1880,6 +1888,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2556,10 +2568,6 @@ msgstr "Tipe bus tampilan tidak didukung" msgid "Unsupported format" msgstr "Format tidak didukung" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operasi yang tidak didukung" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4676,6 +4684,9 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Operasi yang tidak didukung" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3f8322c8dd..9f4bf97a73 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -107,6 +107,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1749,6 +1753,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1856,6 +1864,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2521,10 +2533,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index f87816126a..5a87f5bc06 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -112,6 +112,10 @@ msgstr "%q délka musí být >= 1" msgid "%q must be %d-%d" msgstr "%q musí být %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q musí být <= %d" @@ -1756,6 +1760,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1863,6 +1871,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2530,10 +2542,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 029827eea2..498b1fdaf4 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -115,6 +115,10 @@ msgstr "%q Länge muss >= 1 sein" msgid "%q must be %d-%d" msgstr "%q muss %d-%d sein" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q muss <= %d sein" @@ -1776,6 +1780,10 @@ msgstr "Kein Pulldown-Widerstand am Pin; 1 MOhm wird vorgeschlagen" msgid "No space left on device" msgstr "Kein Speicherplatz mehr verfügbar auf dem Gerät" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Keine solche Datei/Verzeichnis" @@ -1889,6 +1897,10 @@ msgstr "Nur eine alarm-time kann gesetzt werden." msgid "Only one color can be transparent at a time" msgstr "Nur eine Farbe kann transparent sein zu einer Zeit" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Vorgang oder Funktion wird nicht unterstützt" @@ -2577,10 +2589,6 @@ msgstr "Nicht unterstützter display bus type" msgid "Unsupported format" msgstr "Nicht unterstütztes Format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Nicht unterstützte Operation" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update fehlgeschlagen" @@ -4738,6 +4746,9 @@ msgstr "zi muss eine Gleitkommazahl sein" msgid "zi must be of shape (n_section, 2)" msgstr "zi muss die Form (n_section, 2) haben" +#~ msgid "Unsupported operation" +#~ msgstr "Nicht unterstützte Operation" + #~ msgid "divisor must be 4" #~ msgstr "Teiler muss 4 sein" diff --git a/locale/el.po b/locale/el.po index 2685481acc..2c21d3b972 100644 --- a/locale/el.po +++ b/locale/el.po @@ -107,6 +107,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1749,6 +1753,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1856,6 +1864,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2521,10 +2533,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 902fe0fc03..399fbfd5e7 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -114,6 +114,10 @@ msgstr "%q length must be >= 1" msgid "%q must be %d-%d" msgstr "%q must be %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1762,6 +1766,10 @@ msgstr "No pulldown on pin; 1Mohm recommended" msgid "No space left on device" msgstr "No space left on device" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "No such file/directory" @@ -1873,6 +1881,10 @@ msgstr "Only one alarm.time alarm can be set." msgid "Only one color can be transparent at a time" msgstr "Only one colour can be transparent at a time" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operation or feature not supported" @@ -2552,10 +2564,6 @@ msgstr "Unsupported display bus type" msgid "Unsupported format" msgstr "Unsupported format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Unsupported operation" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update failed" @@ -4677,6 +4685,9 @@ msgstr "zi must be of float type" msgid "zi must be of shape (n_section, 2)" msgstr "zi must be of shape (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Unsupported operation" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/es.po b/locale/es.po index eeffad5f55..d1e4f3205e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -116,6 +116,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "%q debe ser %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1784,6 +1788,10 @@ msgstr "No hay pulldown en el pin; 1Mohm recomendado" msgid "No space left on device" msgstr "No queda espacio en el dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "No existe el archivo/directorio" @@ -1897,6 +1905,10 @@ msgstr "Solamente una alarm.time puede ser configurada." msgid "Only one color can be transparent at a time" msgstr "Solo un color puede ser transparente a la vez" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operación no característica no soportada" @@ -2583,10 +2595,6 @@ msgstr "Sin capacidad de bus tipo display" msgid "Unsupported format" msgstr "Formato no soportado" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operación no soportada" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "La actualización fallo" @@ -4724,6 +4732,9 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "Unsupported operation" +#~ msgstr "Operación no soportada" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/fil.po b/locale/fil.po index eb24473bcb..ea43686206 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -108,6 +108,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1764,6 +1768,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Walang file/directory" @@ -1874,6 +1882,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2543,10 +2555,6 @@ msgstr "Hindi supportadong tipo ng bitmap" msgid "Unsupported format" msgstr "Hindi supportadong format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Hindi sinusuportahang operasyon" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4687,6 +4695,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Unsupported operation" +#~ msgstr "Hindi sinusuportahang operasyon" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Ang liwanag ay dapat sa gitna ng 0 o 255" diff --git a/locale/fr.po b/locale/fr.po index d8b286ade6..27fdb3a54a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -116,6 +116,10 @@ msgstr "La longueur de %q doit être >= 1" msgid "%q must be %d-%d" msgstr "%q doit être %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q doit être <= %d" @@ -1795,6 +1799,10 @@ msgstr "Pas de pulldown sur la broche ; 1Mohm recommandé" msgid "No space left on device" msgstr "Aucun espace libre sur le dispositif" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Fichier/répertoire introuvable" @@ -1908,6 +1916,10 @@ msgstr "Seulement une alarme alarm.time peut être réglée." msgid "Only one color can be transparent at a time" msgstr "Une seule couleur peut être transparente à la fois" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Opération ou fonction non supportée" @@ -2600,10 +2612,6 @@ msgstr "Type de bus d'affichage non supporté" msgid "Unsupported format" msgstr "Format non supporté" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Opération non supportée" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Mise-à-jour échouée" @@ -4755,6 +4763,9 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Opération non supportée" + #~ msgid "divisor must be 4" #~ msgstr "le diviseur doit être 4" diff --git a/locale/hi.po b/locale/hi.po index dfb8add290..5f18b16a23 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -107,6 +107,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1749,6 +1753,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1856,6 +1864,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2521,10 +2533,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index e14619c464..08fd145a80 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -114,6 +114,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1773,6 +1777,10 @@ msgstr "" msgid "No space left on device" msgstr "Non che spazio sul dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Nessun file/directory esistente" @@ -1884,6 +1892,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2560,10 +2572,6 @@ msgstr "tipo di bitmap non supportato" msgid "Unsupported format" msgstr "Formato non supportato" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operazione non supportata" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4707,6 +4715,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Unsupported operation" +#~ msgstr "Operazione non supportata" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/ja.po b/locale/ja.po index 808bea05c3..d5615d92f8 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -112,6 +112,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1760,6 +1764,10 @@ msgstr "ピンにプルダウンがありません。1Mオーム推奨" msgid "No space left on device" msgstr "デバイスに空き容量が残っていません" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "指定されたファイル/ディレクトリはありません" @@ -1869,6 +1877,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2536,10 +2548,6 @@ msgstr "" msgid "Unsupported format" msgstr "非対応の形式" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "非対応の操作" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4663,6 +4671,9 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Unsupported operation" +#~ msgstr "非対応の操作" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Brightnessは0から255の間でなければなりません" diff --git a/locale/ko.po b/locale/ko.po index 5f556fee31..21e4bd346a 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -108,6 +108,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1752,6 +1756,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1859,6 +1867,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2525,10 +2537,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 3de959fa49..a2dc9ab51f 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -110,6 +110,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1761,6 +1765,10 @@ msgstr "Geen pulldown op pin; 1MOhm aangeraden" msgid "No space left on device" msgstr "Geen ruimte meer beschikbaar op apparaat" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Bestand/map bestaat niet" @@ -1874,6 +1882,10 @@ msgstr "Slechts één alarm.time alarm kan worden ingesteld." msgid "Only one color can be transparent at a time" msgstr "Er kan maar één kleur per keer transparant zijn" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2549,10 +2561,6 @@ msgstr "Niet-ondersteund beeldscherm bus type" msgid "Unsupported format" msgstr "Niet-ondersteunde format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Niet-ondersteunde operatie" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update Mislukt" @@ -4683,6 +4691,9 @@ msgstr "zi moet van type float zijn" msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "Unsupported operation" +#~ msgstr "Niet-ondersteunde operatie" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Helderheid moet tussen de 0 en 255 liggen" diff --git a/locale/pl.po b/locale/pl.po index f1cf6f9604..2b1d6ea123 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -112,6 +112,10 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -1760,6 +1764,10 @@ msgstr "" msgid "No space left on device" msgstr "Brak miejsca" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Brak pliku/katalogu" @@ -1867,6 +1875,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "W danym momencie przezroczysty może być tylko jeden kolor" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2532,10 +2544,6 @@ msgstr "Zły typ magistrali wyświetlaczy" msgid "Unsupported format" msgstr "Zły format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Zła operacja" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -4654,6 +4662,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Unsupported operation" +#~ msgstr "Zła operacja" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Jasność musi być pomiędzy 0 a 255" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 43ad72c6c0..e9cf974632 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-05-08 16:37+0000\n" +"PO-Revision-Date: 2022-05-14 12:35+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.12.1\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -116,6 +116,10 @@ msgstr "o comprimento %q deve ser >=1" msgid "%q must be %d-%d" msgstr "o %q deve ser %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "%q deve ser 1 quando %q for verdadeiro" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q deve ser <= %d" @@ -1790,6 +1794,10 @@ msgstr "Não há pulldown no pino; É recomendável utilizar um resistor de 1M o msgid "No space left on device" msgstr "Não resta espaço no dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "Não existe tal dispositivo" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Este arquivo/diretório não existe" @@ -1902,6 +1910,10 @@ msgstr "Apenas um alarme alarm.time pode ser definido." msgid "Only one color can be transparent at a time" msgstr "Apenas uma cor pode ser transparente de cada vez" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "A operação não é permitida" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "A operação ou o recurso não é suportado" @@ -2596,10 +2608,6 @@ msgstr "Não há suporte para o tipo do display bus" msgid "Unsupported format" msgstr "Formato não suportado" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operação não suportada" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "A atualização falou" @@ -4748,6 +4756,9 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Operação não suportada" + #~ msgid "divisor must be 4" #~ msgstr "o divisor deve ser 4" diff --git a/locale/ru.po b/locale/ru.po index 95afcbcd8d..9b8778f71b 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -115,6 +115,10 @@ msgstr "Длинна %q должна быть >= 1" msgid "%q must be %d-%d" msgstr "%q должен быть %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q должен быть <= %d" @@ -1787,6 +1791,10 @@ msgstr "Отсутствует подтяжка к земле на пине; Р msgid "No space left on device" msgstr "На устройстве не осталось свободного места" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Файл/директория не существует" @@ -1898,6 +1906,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2570,10 +2582,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index df9e58e816..80a5d6cb27 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-04-26 15:40+0000\n" +"PO-Revision-Date: 2022-05-14 12:35+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.12.1-dev\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -115,6 +115,10 @@ msgstr "längden på %q måste vara >= 1" msgid "%q must be %d-%d" msgstr "%q måste vara %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "%q måste vara 1 när %q är sann" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q måste vara <= %d" @@ -1564,7 +1568,7 @@ msgstr "Datastorlek matchar inte" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Mismatched swap flag" -msgstr "" +msgstr "Felaktig swapflagga" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" @@ -1771,6 +1775,10 @@ msgstr "Ingen pulldown på pinnen; 1Mohm rekommenderas" msgid "No space left on device" msgstr "Inget utrymme kvar på enheten" +#: py/moduerrno.c +msgid "No such device" +msgstr "Ingen sådan enhet" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Ingen sådan fil/katalog" @@ -1883,6 +1891,10 @@ msgstr "Endast ett alarm.time kan ställas in." msgid "Only one color can be transparent at a time" msgstr "Bara en färg kan vara genomskinlig i taget" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "Åtgärden inte tillåten" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operation eller funktion stöds inte" @@ -2567,10 +2579,6 @@ msgstr "Busstyp för display stöds inte" msgid "Unsupported format" msgstr "Formatet stöds inte" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Åtgärd som inte stöds" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Uppdateringen misslyckades" @@ -4705,6 +4713,9 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "Unsupported operation" +#~ msgstr "Åtgärd som inte stöds" + #~ msgid "divisor must be 4" #~ msgstr "divisor måste vara 4" diff --git a/locale/tr.po b/locale/tr.po index ab5c85bab4..c64c90b204 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -119,6 +119,10 @@ msgstr "%q boyutu >=1 olmalıdır" msgid "%q must be %d-%d" msgstr "%q, %d-%d olmalıdır" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q <= %d olmalıdır" @@ -1766,6 +1770,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1873,6 +1881,10 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" @@ -2541,10 +2553,6 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index c4218c29e4..5e1b146532 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -118,6 +118,10 @@ msgstr "%q cháng dù bì xū >= 1" msgid "%q must be %d-%d" msgstr "%q bì xū wéi %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q bì xū <= %d" @@ -1784,6 +1788,10 @@ msgstr "Yǐn jiǎo shàng méiyǒu xiàlā; 1Mohm tuījiàn" msgid "No space left on device" msgstr "Shèbèi shàng méiyǒu kònggé" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Méiyǒu cǐ lèi wénjiàn/mùlù" @@ -1896,6 +1904,10 @@ msgstr "zhǐ néng shè zhì yí gè bào jǐng." msgid "Only one color can be transparent at a time" msgstr "Yīcì zhǐ néng yǒuyī zhǒng yánsè shì tòumíng de" +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + #: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "bù zhī chí cāo zuò huò gōng néng" @@ -2578,10 +2590,6 @@ msgstr "Bù zhīchí de gōnggòng qìchē lèixíng" msgid "Unsupported format" msgstr "Bù zhīchí de géshì" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Bù zhīchí de cāozuò" - #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "gēng xīn shī bài" @@ -4717,6 +4725,9 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "Unsupported operation" +#~ msgstr "Bù zhīchí de cāozuò" + #~ msgid "divisor must be 4" #~ msgstr "èr chóng zòu bì xū shì 4" diff --git a/main.c b/main.c index a3cc01d165..17fe8167f2 100644 --- a/main.c +++ b/main.c @@ -277,10 +277,10 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { memorymonitor_reset(); #endif - filesystem_flush(); - stop_mp(); - free_memory(heap); - supervisor_move_memory(); + // Disable user related BLE state that uses the micropython heap. + #if CIRCUITPY_BLEIO + bleio_user_reset(); + #endif #if CIRCUITPY_CANIO common_hal_canio_reset(); @@ -297,6 +297,12 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { #endif reset_port(); reset_board(); + + // Free the heap last because other modules may reference heap memory and need to shut down. + filesystem_flush(); + stop_mp(); + free_memory(heap); + supervisor_move_memory(); } STATIC void print_code_py_status_message(safe_mode_t safe_mode) { @@ -645,6 +651,12 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re // Done waiting, start the board back up. + // We delay resetting BLE until after the wait in case we're transferring + // more files over. + #if CIRCUITPY_BLEIO + bleio_reset(); + #endif + // free code allocation if unused if ((next_code_options & next_code_stickiness_situation) == 0) { free_memory(next_code_allocation); @@ -888,6 +900,7 @@ int __attribute__((used)) main(void) { serial_init(); #if CIRCUITPY_BLEIO + bleio_reset(); supervisor_bluetooth_enable_workflow(); supervisor_start_bluetooth(); #endif diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index fd9e6cc2e6..0ae0c58b42 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for displayio build to make room for additional frozen libs. LONGINT_IMPL = NONE CIRCUITPY_KEYPAD = 0 +CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/pewpew_lcd/board.c b/ports/atmel-samd/boards/pewpew_lcd/board.c new file mode 100644 index 0000000000..8198a3c83d --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/board.c @@ -0,0 +1,104 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +#include "shared-bindings/board/__init__.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/busio/SPI.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +uint8_t display_init_sequence[] = { + 0xe2, 0, // reset + 0x2f, 0, // power on + 0x80, 0, // contrast 0 + 0xa4, 0, // display normal + 0xaf, 0, // display on + 0x40, 0, // start line 0 +}; + +void board_init(void) { + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_PA23, &pin_PA22, NULL, false); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + NULL, // Command or data + &pin_PA19, // Chip select + &pin_PA18, // Reset + 40000000LL, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 96, // Width + 68, // Height + 0, // column start + 0, // row start + 180, // rotation + 1, // Color depth + true, // grayscale + false, // pixels in byte share row. Only used with depth < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + false, // reverse_pixels_in_word + 0, // Set column command + 0, // Set row command + 0, // Write memory command + display_init_sequence, + sizeof(display_init_sequence), + NULL, // &pin_PA17, // brightness pin + NO_BRIGHTNESS_COMMAND, + 0.0f, // brightness + false, // auto_brightness + false, // single_byte_bounds + true, // data as commands + true, // auto_refresh + 2, // native_frames_per_second + true, // backlight_on_high + true); // SH1107_addressing +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h new file mode 100644 index 0000000000..4123e7a135 --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h @@ -0,0 +1,16 @@ +#define MICROPY_HW_BOARD_NAME "PewPew LCD" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (48 * 1024) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 + +#define SAMD21_BOD33_LEVEL (6) +#define CIRCUITPY_REPL_LOGO (0) diff --git a/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk new file mode 100644 index 0000000000..2bf4992e25 --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk @@ -0,0 +1,57 @@ +USB_VID = 0x1209 +USB_PID = 0xD1B5 +USB_PRODUCT = "PewPew LCD" +USB_MANUFACTURER = "Radomir Dopieralski" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +CIRCUITPY_FULL_BUILD = 0 + +CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_TOUCHIO = 1 +CIRCUITPY_PWMIO = 1 +CIRCUITPY_MATH = 0 + +CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOBUSIO_I2SOUT = 0 +CIRCUITPY_AUDIOCORE = 0 +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_AUDIOMIXER = 0 +CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_AUDIOPWMIO = 0 +CIRCUITPY_BITBANG_APA102 = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 +CIRCUITPY_BITMAPTOOLS = 0 +CIRCUITPY_BLEIO = 0 +CIRCUITPY_BUSDEVICE = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_PS2IO = 0 +CIRCUITPY_PULSEIO = 0 +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 +CIRCUITPY_ULAB = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 +CIRCUITPY_USB_VENDOR = 0 +CIRCUITPY_VECTORIO = 0 +CIRCUITPY_RAINBOWIO = 0 + +CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf +OPTIMIZATION_FLAGS = -Os +FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-lcd diff --git a/ports/atmel-samd/boards/pewpew_lcd/pins.c b/ports/atmel-samd/boards/pewpew_lcd/pins.c new file mode 100644 index 0000000000..13bcf06f4e --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/pins.c @@ -0,0 +1,28 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR__SCK), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR__MOSI), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR__CS), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR__RST), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR__BL), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR__UP), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR__DOWN), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR__LEFT), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR__RIGHT), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR__O), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR__X), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PA14) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h index 388041b115..f6e51ea583 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h @@ -37,7 +37,7 @@ {.scl = &pin_GPIO40, .sda = &pin_GPIO41}} #define CIRCUITPY_BOARD_SPI (1) -#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO35, .mosi = &pin_GPIO34, .miso = &pin_GPIO36}} +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO36, .mosi = &pin_GPIO35, .miso = &pin_GPIO37}} #define CIRCUITPY_BOARD_UART (1) #define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO5, .rx = &pin_GPIO16}} diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c index 0a7bcdb165..5d0a3c0baa 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c @@ -36,15 +36,15 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO34) }, - { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, - - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO38) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO39) }, diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c b/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c new file mode 100644 index 0000000000..5c71b80fc0 --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Wai Weng for Cytron Technologies + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + // Turn on VP by default. + gpio_set_direction(38, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(38, true); +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h new file mode 100644 index 0000000000..478a06c70a --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Cytron Maker Feather AIoT S3" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO46) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO13) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO41) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO42) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO6) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO10) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO5) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO11) +#define DEFAULT_UART_BUS_TX (&pin_GPIO4) + +#define DOUBLE_TAP_PIN (&pin_GPIO17) diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk new file mode 100644 index 0000000000..7a7a032e2c --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x303A +USB_PID = 0x80F9 +USB_PRODUCT = "Cytron Maker Feather AIoT S3" +USB_MANUFACTURER = "Cytron" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=8MB + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c b/ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c new file mode 100644 index 0000000000..92e8e7cfc1 --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c @@ -0,0 +1,90 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_VIN), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_VBATT), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_VP_EN), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_RGB), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig b/ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig new file mode 100644 index 0000000000..f508f4a67c --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig @@ -0,0 +1,34 @@ +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM Clock and CS IO for ESP32S3 +# +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM Clock and CS IO for ESP32S3 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c new file mode 100644 index 0000000000..aa0cf7657a --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c @@ -0,0 +1,17 @@ +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" + +#include "components/driver/include/driver/gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h new file mode 100644 index 0000000000..71987994e7 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h @@ -0,0 +1,13 @@ +// Define board +#define MICROPY_HW_BOARD_NAME "LILYGO TTGO T-OI PLUS" +#define MICROPY_HW_MCU_NAME "ESP32-C3" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO3) + +// I2C +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO18, .sda = &pin_GPIO19}} + +// UART +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk new file mode 100644 index 0000000000..2f66e69415 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0xC3C30000 +CIRCUITPY_CREATION_ID = 0x00C30002 + +IDF_TARGET = esp32c3 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c new file mode 100644 index 0000000000..963115bf1c --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c @@ -0,0 +1,29 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig new file mode 100644 index 0000000000..7c85db8776 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig @@ -0,0 +1,5 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="LILYGO TTGO T-OI PLUS" +# end of LWIP diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index d72f9dbf02..943e44e7cd 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -574,6 +574,9 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool } void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { + if (!common_hal_bleio_adapter_get_advertising(self)) { + return; + } int err_code = ble_gap_ext_adv_stop(0); self->user_advertising = false; diff --git a/ports/espressif/common-hal/_bleio/__init__.c b/ports/espressif/common-hal/_bleio/__init__.c index 7eba47d6a1..e25f9b0ef1 100644 --- a/ports/espressif/common-hal/_bleio/__init__.c +++ b/ports/espressif/common-hal/_bleio/__init__.c @@ -42,6 +42,17 @@ // #include "common-hal/_bleio/bonding.h" #include "common-hal/_bleio/ble_events.h" +void bleio_user_reset() { + // Stop any user scanning or advertising. + common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); + common_hal_bleio_adapter_stop_advertising(&common_hal_bleio_adapter_obj); + + ble_event_remove_heap_handlers(); + + // Maybe start advertising the BLE workflow. + supervisor_bluetooth_background(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Set this explicitly to save data. diff --git a/ports/espressif/common-hal/_bleio/ble_events.c b/ports/espressif/common-hal/_bleio/ble_events.c index 1ccd72cb61..a072a80623 100644 --- a/ports/espressif/common-hal/_bleio/ble_events.c +++ b/ports/espressif/common-hal/_bleio/ble_events.c @@ -31,6 +31,7 @@ #include #include +#include "py/gc.h" #include "py/misc.h" #include "py/mpstate.h" #include "py/runtime.h" @@ -44,6 +45,17 @@ void ble_event_reset(void) { MP_STATE_VM(ble_event_handler_entries) = NULL; } +void ble_event_remove_heap_handlers(void) { + ble_event_handler_entry_t *it = MP_STATE_VM(ble_event_handler_entries); + while (it != NULL) { + // If the param is on the heap, then delete the handler. + if (HEAP_PTR(it->param)) { + ble_event_remove_handler(it->func, it->param); + } + it = it->next; + } +} + void ble_event_add_handler_entry(ble_event_handler_entry_t *entry, ble_gap_event_fn *func, void *param) { ble_event_handler_entry_t *it = MP_STATE_VM(ble_event_handler_entries); diff --git a/ports/espressif/common-hal/_bleio/ble_events.h b/ports/espressif/common-hal/_bleio/ble_events.h index 03ff351118..cc6c9e92f7 100644 --- a/ports/espressif/common-hal/_bleio/ble_events.h +++ b/ports/espressif/common-hal/_bleio/ble_events.h @@ -40,6 +40,7 @@ typedef struct ble_event_handler_entry { } ble_event_handler_entry_t; void ble_event_reset(void); +void ble_event_remove_heap_handlers(void); void ble_event_add_handler(ble_gap_event_fn *func, void *param); void ble_event_remove_handler(ble_gap_event_fn *func, void *param); diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 11709eda40..bf606ad159 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -283,10 +283,6 @@ void reset_port(void) { watchdog_reset(); #endif - #if CIRCUITPY_BLEIO - bleio_reset(); - #endif - #if CIRCUITPY_WIFI wifi_reset(); #endif diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index f5d2f96715..cf3f9382d7 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -35,6 +35,7 @@ #include "nrf_sdm.h" #include "nrf_soc.h" #include "nrfx_power.h" +#include "py/gc.h" #include "py/misc.h" #include "py/mpstate.h" @@ -56,6 +57,17 @@ void ble_drv_reset() { sd_flash_operation_status = SD_FLASH_OPERATION_DONE; } +void ble_drv_remove_heap_handlers(void) { + ble_drv_evt_handler_entry_t *it = MP_STATE_VM(ble_drv_evt_handler_entries); + while (it != NULL) { + // If the param is on the heap, then delete the handler. + if (HEAP_PTR(it->param)) { + ble_drv_remove_event_handler(it->func, it->param); + } + it = it->next; + } +} + void ble_drv_add_event_handler_entry(ble_drv_evt_handler_entry_t *entry, ble_drv_evt_handler_t func, void *param) { ble_drv_evt_handler_entry_t *it = MP_STATE_VM(ble_drv_evt_handler_entries); while (it != NULL) { diff --git a/ports/nrf/bluetooth/ble_drv.h b/ports/nrf/bluetooth/ble_drv.h index e7649fceee..798e70e1fb 100644 --- a/ports/nrf/bluetooth/ble_drv.h +++ b/ports/nrf/bluetooth/ble_drv.h @@ -67,6 +67,7 @@ typedef struct ble_drv_evt_handler_entry { } ble_drv_evt_handler_entry_t; void ble_drv_reset(void); +void ble_drv_remove_heap_handlers(void); void ble_drv_add_event_handler(ble_drv_evt_handler_t func, void *param); void ble_drv_remove_event_handler(ble_drv_evt_handler_t func, void *param); diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index f7d35cbdb5..38dcdd9041 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -380,9 +380,11 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, c !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } + if (mp_hal_is_interrupted()) { + return -1; + } } - if (self->conn_handle == BLE_CONN_HANDLE_INVALID || - mp_hal_is_interrupted()) { + if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { return -1; } diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index e02cf306af..1d59983896 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -94,6 +94,17 @@ void check_sec_status(uint8_t sec_status) { } } +void bleio_user_reset() { + // Stop any user scanning or advertising. + common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); + common_hal_bleio_adapter_stop_advertising(&common_hal_bleio_adapter_obj); + + ble_drv_remove_heap_handlers(); + + // Maybe start advertising the BLE workflow. + supervisor_bluetooth_background(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Set this explicitly to save data. diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 5c1139271d..0d1f71e886 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -246,10 +246,6 @@ void reset_port(void) { timers_reset(); - #if CIRCUITPY_BLEIO - bleio_reset(); - #endif - #if CIRCUITPY_WATCHDOG watchdog_reset(); #endif diff --git a/ports/raspberrypi/bindings/rp2pio/__init__.c b/ports/raspberrypi/bindings/rp2pio/__init__.c index b3b45dc923..941ede2e12 100644 --- a/ports/raspberrypi/bindings/rp2pio/__init__.c +++ b/ports/raspberrypi/bindings/rp2pio/__init__.c @@ -30,7 +30,14 @@ #include "bindings/rp2pio/StateMachine.h" #include "bindings/rp2pio/__init__.h" -//| """Hardware interface to RP2 series' programmable IO (PIO) peripheral.""" +//| """Hardware interface to RP2 series' programmable IO (PIO) peripheral. +//| +//| .. note:: This module is intended to be used with the `adafruit_pioasm library +//| `_. For an +//| introduction and guide to working with PIO in CircuitPython, see `this +//| Learn guide `_. +//| +//| """ //| //| def pins_are_sequential(pins: List[microcontroller.Pin]) -> bool: diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c b/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c new file mode 100644 index 0000000000..635e767a8f --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" +#include "supervisor/shared/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + // turn off any left over LED + board_reset_user_neopixels(&pin_GPIO25, 62); +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h new file mode 100644 index 0000000000..5acfceba9d --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h @@ -0,0 +1,4 @@ +#define MICROPY_HW_BOARD_NAME "RP2.65-F" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO25) diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk new file mode 100644 index 0000000000..4cba650ec4 --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk @@ -0,0 +1,17 @@ +# pid.codes ZR +USB_VID = 0x1209 +USB_PID = 0x5a52 + +USB_PRODUCT = "RP2.65-F" +USB_MANUFACTURER = "ZRichard" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ,W25Q128JVxQ" + +CIRCUITPY__EVE = 1 + + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_MIDI diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h b/ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c b/ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c new file mode 100644 index 0000000000..02c69c014f --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c @@ -0,0 +1,32 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_ROW0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_COL0), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_ROW1), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_COL1), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_ROW2), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_COL2), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_ROW3), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_COL3), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_ROW4), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_COL4), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_ROW5), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_COL5), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_ROW6), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_COL6), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_ROW7), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_COL7), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_ROW8), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_ROW9), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_RV1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_RV2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_RV3), MP_ROM_PTR(&pin_GPIO29) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index 526415ca30..f7905f6945 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -14,6 +14,7 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C CIRCUITPY_NVM = 1 CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_ZLIB = 0 MCU_SERIES = F4 diff --git a/py/gc.h b/py/gc.h index ddd07fb4c0..b9036ff4ba 100644 --- a/py/gc.h +++ b/py/gc.h @@ -35,11 +35,16 @@ #define WORDS_PER_BLOCK ((MICROPY_BYTES_PER_GC_BLOCK) / MP_BYTES_PER_OBJ_WORD) #define BYTES_PER_BLOCK (MICROPY_BYTES_PER_GC_BLOCK) +#define HEAP_PTR(ptr) ( \ + MP_STATE_MEM(gc_pool_start) != 0 /* Not on the heap if it isn't inited */ \ + && ptr >= (void *)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \ + && ptr < (void *)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \ + ) + // ptr should be of type void* #define VERIFY_PTR(ptr) ( \ ((uintptr_t)(ptr) & (BYTES_PER_BLOCK - 1)) == 0 /* must be aligned on a block */ \ - && ptr >= (void *)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \ - && ptr < (void *)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \ + && HEAP_PTR(ptr) \ ) void gc_init(void *start, void *end); diff --git a/py/moduerrno.c b/py/moduerrno.c index 56d903f115..743be0b85d 100644 --- a/py/moduerrno.c +++ b/py/moduerrno.c @@ -140,7 +140,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { const compressed_string_t *desc = NULL; switch (MP_OBJ_SMALL_INT_VALUE(errno_val)) { case EPERM: - desc = MP_ERROR_TEXT("Permission denied"); + desc = MP_ERROR_TEXT("Operation not permitted"); break; case ENOENT: desc = MP_ERROR_TEXT("No such file/directory"); @@ -155,7 +155,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { desc = MP_ERROR_TEXT("File exists"); break; case ENODEV: - desc = MP_ERROR_TEXT("Unsupported operation"); + desc = MP_ERROR_TEXT("No such device"); break; case EINVAL: desc = MP_ERROR_TEXT("Invalid argument"); diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 55b527cfa5..f34df306b7 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -54,6 +54,11 @@ extern const mp_obj_type_t mp_type_bleio_BluetoothError; extern const mp_obj_type_t mp_type_bleio_RoleError; extern const mp_obj_type_t mp_type_bleio_SecurityError; +// Resets all user created BLE state in preparation for the heap disappearing. +// It will maintain BLE workflow and connections. +void bleio_user_reset(void); + +// Completely resets the BLE stack including BLE connections. void bleio_reset(void); extern mp_obj_t bleio_set_adapter(mp_obj_t adapter_obj); diff --git a/shared-bindings/alarm/__init__.c b/shared-bindings/alarm/__init__.c index 2d532664b9..7fd14b7641 100644 --- a/shared-bindings/alarm/__init__.c +++ b/shared-bindings/alarm/__init__.c @@ -55,6 +55,9 @@ //| //| For both light sleep and deep sleep, if CircuitPython is connected to a host computer, //| maintaining the connection takes priority and power consumption may not be reduced. +//| +//| For more information about working with alarms and light/deep sleep in CircuitPython, +//| see `this Learn guide `_. //| """ //| sleep_memory: SleepMemory diff --git a/shared-bindings/analogio/__init__.c b/shared-bindings/analogio/__init__.c index 89096ae9aa..eb956d0eb7 100644 --- a/shared-bindings/analogio/__init__.c +++ b/shared-bindings/analogio/__init__.c @@ -59,12 +59,11 @@ //| :py:meth:`~analogio.AnalogIn.deinit` the hardware. The last step is optional //| because CircuitPython will do it automatically after the program finishes. //| -//| For the essentials of `analogio`, see the CircuitPython Essentials -//| Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-analog-in +//| For the essentials of `analogio`, see the `CircuitPython Essentials +//| Learn guide `_ //| -//| For more information on using `analogio`, see this additional Learn guide: -//| https://learn.adafruit.com/circuitpython-basics-analog-inputs-and-outputs +//| For more information on using `analogio`, see `this additional Learn guide +//| `_ //| """ //| diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c index d6c408b143..13f02b1ea9 100644 --- a/shared-bindings/audiomp3/__init__.c +++ b/shared-bindings/audiomp3/__init__.c @@ -31,7 +31,12 @@ #include "shared-bindings/audiomp3/MP3Decoder.h" -//| """Support for MP3-compressed audio files""" +//| """Support for MP3-compressed audio files +//| +//| For more infomration about working with MP3 files in CircuitPython, +//| see `this CircuitPython Essentials Learn guide page +//| `_. +//| """ //| STATIC const mp_rom_map_elem_t audiomp3_module_globals_table[] = { diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index df6292afec..5122d039e8 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -43,7 +43,13 @@ #include "extmod/vfs_posix.h" #endif -//| """Collection of bitmap manipulation tools""" +//| """Collection of bitmap manipulation tools +//| +//| .. note:: If you're looking for information about displaying bitmaps on +//| screens in CircuitPython, see `this Learn guide +//| `_ +//| for information about using the :py:mod:`displayio` module. +//| """ //| STATIC int16_t validate_point(mp_obj_t point, int16_t default_value) { diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index a496ff0b9c..e4003d4f6b 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -47,9 +47,9 @@ //| the default pins and settings. For more information about serial communcication //| in CircuitPython, see the :mod:`busio`. //| -//| For more information regarding the typical usage of :py:mod:`board`, refer to the CircuitPython -//| Essentials Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pins-and-modules +//| For more information regarding the typical usage of :py:mod:`board`, refer to the `CircuitPython +//| Essentials Learn guide +//| `_ //| //| .. warning:: The board module varies by board. The APIs documented here may or may not be //| available on a specific board.""" diff --git a/shared-bindings/digitalio/__init__.c b/shared-bindings/digitalio/__init__.c index 8bc872be99..9a9db69816 100644 --- a/shared-bindings/digitalio/__init__.c +++ b/shared-bindings/digitalio/__init__.c @@ -73,12 +73,11 @@ //| led.value = False //| time.sleep(0.1) //| -//| For the essentials of `digitalio`, see the CircuitPython Essentials -//| Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-digital-in-out +//| For the essentials of `digitalio`, see the `CircuitPython Essentials +//| Learn guide `_ //| -//| For more information on using `digitalio`, see this additional Learn guide: -//| https://learn.adafruit.com/circuitpython-digital-inputs-and-outputs +//| For more information on using `digitalio`, see `this additional Learn guide +//| `_ //| """ STATIC const mp_rom_map_elem_t digitalio_module_globals_table[] = { diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 253887f1de..b19c0bac53 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -170,14 +170,20 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); } + const bool sh1107_addressing = args[ARG_SH1107_addressing].u_bool; + const mp_int_t color_depth = args[ARG_color_depth].u_int; + if (sh1107_addressing && color_depth != 1) { + mp_raise_ValueError_varg(translate("%q must be 1 when %q is True"), MP_QSTR_color_depth, MP_QSTR_SH1107_addressing); + } + primary_display_t *disp = allocate_display_or_raise(); displayio_display_obj_t *self = &disp->display; - ; + self->base.type = &displayio_display_type; common_hal_displayio_display_construct( self, display_bus, args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, - args[ARG_color_depth].u_int, args[ARG_grayscale].u_bool, + color_depth, args[ARG_grayscale].u_bool, args[ARG_pixels_in_byte_share_row].u_bool, args[ARG_bytes_per_cell].u_bool, args[ARG_reverse_pixels_in_byte].u_bool, @@ -194,7 +200,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a args[ARG_auto_refresh].u_bool, args[ARG_native_frames_per_second].u_int, args[ARG_backlight_on_high].u_bool, - args[ARG_SH1107_addressing].u_bool + sh1107_addressing ); return self; diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 931ec3f77a..2e52f12e84 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -51,9 +51,9 @@ //| The `displayio` module contains classes to manage display output //| including synchronizing with refresh rates and partial updating. //| -//| For more a more thorugh explanation and guide for using `displayio`, please -//| refer to this Learn guide: -//| https://learn.adafruit.com/circuitpython-display-support-using-displayio +//| For more a more thorough explanation and guide for using `displayio`, please +//| refer to `this Learn guide +//| `_. //| """ //| diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index fc5c011eb3..ea1b8a628b 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -33,7 +33,15 @@ #include "shared-bindings/fontio/BuiltinFont.h" #include "shared-bindings/fontio/Glyph.h" -//| """Core font related data structures""" +//| """Core font related data structures +//| +//| .. note:: This module is intended only for low-level usage. For working with +//| fonts in CircuitPython see the `adafruit_bitmap_font library +//| `_. +//| For information on creating custom fonts for use in CircuitPython, see +//| `this Learn guide `_ +//| +//| """ //| STATIC const mp_rom_map_elem_t fontio_module_globals_table[] = { diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index ceba9be1ba..707080cfbf 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -43,8 +43,9 @@ //| """Pin references and cpu functionality //| -//| The `microcontroller` module defines the pins from the perspective of the -//| microcontroller. See :py:mod:`board` for board-specific pin mappings.""" +//| The `microcontroller` module defines the pins and other bare-metal hardware +//| from the perspective of the microcontroller. See :py:mod:`board` for +//| board-specific pin mappings.""" //| //| from nvm import ByteArray //| from watchdog import WatchDogTimer diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index 9375beab06..d0234fe451 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -95,13 +95,13 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { //| //| .. note:: //| -//| This library is typically not used by user level code. +//| This module is typically not used by user level code. //| -//| For more information on actually using NeoPixels, refer to the CircuitPython -//| Essentials Learn guide: https://learn.adafruit.com/circuitpython-essentials/circuitpython-neopixel +//| For more information on actually using NeoPixels, refer to the `CircuitPython +//| Essentials Learn guide `_ //| -//| For a much more thorough guide about using NeoPixels, refer to the Adadfruit NeoPixel Überguide: -//| https://learn.adafruit.com/adafruit-neopixel-uberguide +//| For a much more thorough guide about using NeoPixels, refer to the `Adafruit NeoPixel Überguide +//| `_. //| //| """ //| diff --git a/shared-bindings/pwmio/__init__.c b/shared-bindings/pwmio/__init__.c index dbe487d580..90aff45819 100644 --- a/shared-bindings/pwmio/__init__.c +++ b/shared-bindings/pwmio/__init__.c @@ -59,9 +59,8 @@ //| hardware after program completion. Use ``deinit()`` or a ``with`` statement //| to do it yourself. //| -//| For the essentials of `pwmio`, see the CircuitPython Essentials -//| Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pwm +//| For the essentials of `pwmio`, see the `CircuitPython Essentials +//| Learn guide `_. //| """ //| diff --git a/shared-bindings/qrio/__init__.c b/shared-bindings/qrio/__init__.c index b848190d7e..04c86fd1ee 100644 --- a/shared-bindings/qrio/__init__.c +++ b/shared-bindings/qrio/__init__.c @@ -31,9 +31,15 @@ #include "py/obj.h" #include "py/enum.h" -//| """`qrio` module. +//| """Low-level QR code decoding //| -//| Provides the `QRDecoder` object.""" +//| Provides the `QRDecoder` object used for decoding QR codes. For more +//| information about working with QR codes, see +//| `this Learn guide `_. +//| +//| .. note:: This module only handles decoding QR codes. If you are looking +//| to generate a QR code, use the +//| `adafruit_miniqr library `_""" //| STATIC const mp_rom_map_elem_t qrio_module_globals_table[] = { diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 4a3a8384b1..277c8343e0 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -42,9 +42,9 @@ //| CircuitPython does not have an OS, so this module provides this functionality //| directly. -//| For more information regarding using the `storage` module, refer to the CircuitPython -//| Essentials Learn guide: -//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage +//| For more information regarding using the `storage` module, refer to the `CircuitPython +//| Essentials Learn guide +//| `_. //| """ //| diff --git a/shared-bindings/support_matrix.rst b/shared-bindings/support_matrix.rst index 2385183c98..e007e27b47 100644 --- a/shared-bindings/support_matrix.rst +++ b/shared-bindings/support_matrix.rst @@ -4,7 +4,7 @@ Module Support Matrix - Which Modules Are Available on Which Boards =================================================================== The following table lists the available built-in modules for each CircuitPython -capable board. +capable board, as well as each :term:`frozen module` included on it. .. raw:: html @@ -21,6 +21,14 @@ capable board. {% for key, value in support_matrix|dictsort %} {{ '.. _' ~ key|replace(" ", "-") ~ ':' }} * - {{ key }} - - {{ ':py:mod:`' ~ value|join("`, :py:mod:`") ~ '`' }} + - {{ ':py:mod:`' ~ value[0]|join("`, :py:mod:`") ~ '`' }} + + {% for module in value[1] %}\ + {% if loop.index == 1 %}**Frozen Modules:** {% endif %}\ + {% if loop.index > 1 %}, {% endif %}\ + {% if module[1] %}{{ '`' ~ module[0] ~ ' <' ~ module[1] ~ '>`__' }}\ + {% else %}{{ '`' ~ module[0] ~ ' <#>`__' }}\ + {% endif %}\ + {% endfor %} {% endfor %} diff --git a/shared-bindings/terminalio/__init__.c b/shared-bindings/terminalio/__init__.c index 38313dc757..5fd1a2751a 100644 --- a/shared-bindings/terminalio/__init__.c +++ b/shared-bindings/terminalio/__init__.c @@ -38,7 +38,12 @@ //| """Displays text in a TileGrid //| //| The `terminalio` module contains classes to display a character stream on a display. The built -//| in font is available as ``terminalio.FONT``.""" +//| in font is available as ``terminalio.FONT``. +//| +//| .. note:: This module does not give access to the +//| `REPL `_. +//| +//| """ //| //| FONT: fontio.BuiltinFont //| """The built in font""" diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index fe6be555cd..6a3e192cb9 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -78,6 +78,7 @@ vectorio_draw_protocol_impl_t vectorio_vector_shape_draw_protocol_impl = { .draw_update_transform = (draw_update_transform_fun)vectorio_vector_shape_update_transform, .draw_finish_refresh = (draw_finish_refresh_fun)vectorio_vector_shape_finish_refresh, .draw_get_refresh_areas = (draw_get_refresh_areas_fun)vectorio_vector_shape_get_refresh_areas, + .draw_set_dirty = (draw_set_dirty_fun)common_hal_vectorio_vector_shape_set_dirty, }; // Stub checker does not approve of these shared properties. diff --git a/shared-bindings/vectorio/__init__.h b/shared-bindings/vectorio/__init__.h index a34195de26..d4f10c926c 100644 --- a/shared-bindings/vectorio/__init__.h +++ b/shared-bindings/vectorio/__init__.h @@ -17,6 +17,7 @@ typedef bool (*draw_fill_area_fun)(mp_obj_t draw_protocol_self, const _displayio typedef bool (*draw_get_dirty_area_fun)(mp_obj_t draw_protocol_self, displayio_area_t *current_dirty_area); typedef void (*draw_update_transform_fun)(mp_obj_t draw_protocol_self, displayio_buffer_transform_t *group_transform); typedef void (*draw_finish_refresh_fun)(mp_obj_t draw_protocol_self); +typedef void (*draw_set_dirty_fun)(mp_obj_t draw_protocol_self); typedef displayio_area_t *(*draw_get_refresh_areas_fun)(mp_obj_t draw_protocol_self, displayio_area_t *tail); typedef struct _vectorio_draw_protocol_impl_t { @@ -25,6 +26,7 @@ typedef struct _vectorio_draw_protocol_impl_t { draw_update_transform_fun draw_update_transform; draw_finish_refresh_fun draw_finish_refresh; draw_get_refresh_areas_fun draw_get_refresh_areas; + draw_set_dirty_fun draw_set_dirty; } vectorio_draw_protocol_impl_t; // Draw protocol diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 579dca49fc..255cd49e06 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -74,7 +74,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, self->first_manual_refresh = !auto_refresh; self->data_as_commands = data_as_commands; self->backlight_on_high = backlight_on_high; - self->SH1107_addressing = SH1107_addressing; + self->SH1107_addressing = SH1107_addressing && color_depth == 1; self->native_frames_per_second = native_frames_per_second; self->native_ms_per_frame = 1000 / native_frames_per_second; diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index b9179f0a00..1a4e4eafb5 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -66,6 +66,14 @@ void common_hal_displayio_group_set_hidden(displayio_group_t *self, bool hidden) displayio_group_set_hidden_by_parent(layer, hidden); continue; } + #if CIRCUITPY_VECTORIO + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + draw_protocol->draw_protocol_impl->draw_set_dirty(layer); + continue; + } + #endif } } @@ -92,6 +100,14 @@ void displayio_group_set_hidden_by_parent(displayio_group_t *self, bool hidden) displayio_group_set_hidden_by_parent(layer, hidden); continue; } + #if CIRCUITPY_VECTORIO + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + draw_protocol->draw_protocol_impl->draw_set_dirty(layer); + continue; + } + #endif } } @@ -358,33 +374,35 @@ void displayio_group_construct(displayio_group_t *self, mp_obj_list_t *members, bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { // Track if any of the layers finishes filling in the given area. We can ignore any remaining // layers at that point. - for (int32_t i = self->members->len - 1; i >= 0; i--) { - mp_obj_t layer; - #if CIRCUITPY_VECTORIO - const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); - if (draw_protocol != NULL) { - layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); - if (draw_protocol->draw_protocol_impl->draw_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + if (self->hidden == false) { + for (int32_t i = self->members->len - 1; i >= 0; i--) { + mp_obj_t layer; + #if CIRCUITPY_VECTORIO + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + if (draw_protocol->draw_protocol_impl->draw_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; - } - #endif - layer = mp_obj_cast_to_native_base( - self->members->items[i], &displayio_tilegrid_type); - if (layer != MP_OBJ_NULL) { - if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + #endif + layer = mp_obj_cast_to_native_base( + self->members->items[i], &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { + if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; - } - layer = mp_obj_cast_to_native_base( - self->members->items[i], &displayio_group_type); - if (layer != MP_OBJ_NULL) { - if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + layer = mp_obj_cast_to_native_base( + self->members->items[i], &displayio_group_type); + if (layer != MP_OBJ_NULL) { + if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; } } return false; diff --git a/supervisor/shared/bluetooth/file_transfer.c b/supervisor/shared/bluetooth/file_transfer.c index 6c206f35c0..a6a2f8062a 100644 --- a/supervisor/shared/bluetooth/file_transfer.c +++ b/supervisor/shared/bluetooth/file_transfer.c @@ -325,7 +325,6 @@ STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { if (chunk_size == 0) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); return ANY_COMMAND; } @@ -382,7 +381,6 @@ STATIC uint8_t _process_write_data(const uint8_t *raw_buf, size_t command_len) { #endif // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); return ANY_COMMAND; } return WRITE_DATA; @@ -463,7 +461,6 @@ STATIC uint8_t _process_delete(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -517,7 +514,6 @@ STATIC uint8_t _process_mkdir(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -664,7 +660,6 @@ STATIC uint8_t _process_move(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -740,6 +735,14 @@ void supervisor_bluetooth_file_transfer_background(void) { } if (next_command == ANY_COMMAND) { autoreload_resume(AUTORELOAD_SUSPEND_BLE); + // Trigger a reload if the command may have mutated the file system. + if (current_state == WRITE || + current_state == WRITE_DATA || + current_state == DELETE || + current_state == MKDIR || + current_state == MOVE) { + autoreload_trigger(); + } } } running = false; diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 97192adee7..1534288b04 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -13,14 +13,15 @@ import base64 from datetime import date from sh.contrib import git -sys.path.append("../docs") -import shared_bindings_matrix - sys.path.append("adabot") import adabot.github_requests as github -from shared_bindings_matrix import SUPPORTED_PORTS -from shared_bindings_matrix import aliases_by_board +sys.path.append("../docs") +from shared_bindings_matrix import ( + SUPPORTED_PORTS, + aliases_by_board, + support_matrix_by_board, +) BIN = ("bin",) UF2 = ("uf2",) @@ -75,6 +76,7 @@ extension_by_board = { "espressif_esp32c3_devkitm_1_n4": BIN, "lilygo_ttgo_t-01c3": BIN, "microdev_micro_c3": BIN, + "lilygo_ttgo_t-oi-plus": BIN, # broadcom "raspberrypi_zero": KERNEL_IMG, "raspberrypi_zero_w": KERNEL_IMG, @@ -124,20 +126,11 @@ def get_board_mapping(): extensions = extension_by_port[port] extensions = extension_by_board.get(board_path.name, extensions) aliases = aliases_by_board.get(board_path.name, []) - frozen_libraries = [] - with open(os.path.join(board_path, "mpconfigboard.mk")) as mpconfig: - frozen_lines = [ - line for line in mpconfig if line.startswith("FROZEN_MPY_DIRS") - ] - frozen_libraries.extend( - [line[line.rfind("/") + 1 :].strip() for line in frozen_lines] - ) boards[board_id] = { "port": port, "extensions": extensions, "download_count": 0, "aliases": aliases, - "frozen_libraries": frozen_libraries, } for alias in aliases: boards[alias] = { @@ -284,7 +277,7 @@ def generate_download_info(): languages = get_languages() - support_matrix = shared_bindings_matrix.support_matrix_by_board(use_branded_name=False) + support_matrix = support_matrix_by_board(use_branded_name=False) new_stable = "-" not in new_tag @@ -321,10 +314,10 @@ def generate_download_info(): new_version = { "stable": new_stable, "version": new_tag, - "modules": support_matrix[alias], + "modules": support_matrix[alias][0], "languages": languages, "extensions": board_info["extensions"], - "frozen_libraries": board_info["frozen_libraries"], + "frozen_libraries": [frozen[0] for frozen in support_matrix[alias][1]], } current_info[alias]["downloads"] = alias_info["download_count"] current_info[alias]["versions"].append(new_version) diff --git a/tools/ci_fetch_deps.py b/tools/ci_fetch_deps.py index 4406ddf959..491d8da0e5 100644 --- a/tools/ci_fetch_deps.py +++ b/tools/ci_fetch_deps.py @@ -68,14 +68,15 @@ submodules = [] if target == "test": submodules = ["extmod/", "lib/", "tools/", "extmod/ulab", "lib/berkeley-db-1.xx"] elif target == "docs": - submodules = ["extmod/ulab/"] + # used in .readthedocs.yml to generate RTD + submodules = ["extmod/ulab/", "frozen/"] elif target == "mpy-cross-mac": submodules = ["tools/"] # for huffman elif target == "windows": # This builds one board from a number of ports so fill out a bunch of submodules submodules = ["extmod/", "lib/", "tools/", "ports/", "data/nvm.toml/"] elif target == "website": - submodules = ["tools/adabot/"] + submodules = ["tools/adabot/", "frozen/"] else: p = list(pathlib.Path(".").glob(f"ports/*/boards/{target}/mpconfigboard.mk")) if not p: