From 8cc536bb7fe87f626a43cfb3261fc72ae8a7ad59 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 21 Oct 2022 13:20:16 +0300 Subject: [PATCH 001/357] PicoW start_ap() --- ports/raspberrypi/common-hal/wifi/Radio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 3e95ae5cd1..f05215a131 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -168,7 +168,10 @@ void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) { } void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections) { - mp_raise_NotImplementedError(NULL); + if (!common_hal_wifi_radio_get_enabled(self)) { + mp_raise_RuntimeError(translate("wifi is not enabled")); + } + cyw43_arch_enable_ap_mode((const char *)ssid, (const char *)password, CYW43_AUTH_WPA2_AES_PSK); bindings_cyw43_wifi_enforce_pm(); } From 7a50beb67e92ba326177540a00e12081aeedfa54 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Sat, 22 Oct 2022 11:58:44 +0300 Subject: [PATCH 002/357] PicoW more ap work --- ports/raspberrypi/common-hal/wifi/Radio.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index f05215a131..9c2dea85c7 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -171,12 +171,17 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ if (!common_hal_wifi_radio_get_enabled(self)) { mp_raise_RuntimeError(translate("wifi is not enabled")); } + // Is there a better way? + common_hal_wifi_radio_stop_station(self); + cyw43_arch_enable_ap_mode((const char *)ssid, (const char *)password, CYW43_AUTH_WPA2_AES_PSK); + // TODO: Implement authmode check like in espressif bindings_cyw43_wifi_enforce_pm(); } void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self) { - mp_raise_NotImplementedError(NULL); + common_hal_wifi_radio_stop_station(self); + // I mean, since it already does both.. } wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len) { @@ -188,8 +193,12 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t uint64_t start = port_get_raw_ticks(NULL); uint64_t deadline = start + timeout_ms; + // disconnect + common_hal_wifi_radio_stop_station(self); + // connect cyw43_arch_wifi_connect_async((const char *)ssid, (const char *)password, CYW43_AUTH_WPA2_AES_PSK); + // TODO: Implement authmode check like in espressif while (port_get_raw_ticks(NULL) < deadline) { RUN_BACKGROUND_TASKS; From 7545e02a8e9963e086387edcb4792e83596b645f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 26 Oct 2022 10:05:37 -0500 Subject: [PATCH 003/357] add feather rp2040 scorpio --- .../adafruit_feather_rp2040_scorpio/board.c | 29 +++++++++++ .../mpconfigboard.h | 14 ++++++ .../mpconfigboard.mk | 9 ++++ .../pico-sdk-configboard.h | 4 ++ .../adafruit_feather_rp2040_scorpio/pins.c | 48 +++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/board.c create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/pins.c diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/board.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/board.c @@ -0,0 +1,29 @@ +/* + * 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/mpconfigboard.h new file mode 100644 index 0000000000..94b6fcee7b --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/mpconfigboard.h @@ -0,0 +1,14 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 Scorpio" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO16) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO14) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO8) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/mpconfigboard.mk b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/mpconfigboard.mk new file mode 100644 index 0000000000..db06fd728b --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x239A +USB_PID = 0x8122 +USB_PRODUCT = "Feather RP2040 Scorpio" +USB_MANUFACTURER = "Adafruit" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/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/adafruit_feather_rp2040_scorpio/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/pins.c new file mode 100644 index 0000000000..9bf3a71e25 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_scorpio/pins.c @@ -0,0 +1,48 @@ +#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_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL0), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL2), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL3), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL4), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL5), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL6), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL7), MP_ROM_PTR(&pin_GPIO23) }, + + { 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); From 30f07fbf22bfb7e19e27f062d1ab39ab83e7b067 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Oct 2022 18:19:15 +0530 Subject: [PATCH 004/357] schedule pr jobs based on commit specific changes --- .github/workflows/build.yml | 27 ++-- tools/ci_changes_per_commit.py | 227 +++++++++++++++++++++++++++++++++ tools/ci_set_matrix.py | 25 +++- 3 files changed, 266 insertions(+), 13 deletions(-) create mode 100644 tools/ci_changes_per_commit.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8338528c42..c0ab361594 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,20 +125,29 @@ jobs: [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1 [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1 - - name: "Get changes" + - name: Get last commit with checks + id: get-last-commit-with-checks if: github.event_name == 'pull_request' - uses: dorny/paths-filter@v2 - id: filter + working-directory: tools + env: + REPO: ${{ github.repository }} + PULL: ${{ github.event.number }} + GITHUB_TOKEN: ${{ github.token }} + EXCLUDE_COMMIT: ${{ github.event.after }} + run: python3 -u ci_changes_per_commit.py + - name: Get changes + id: get-changes + if: github.event_name == 'pull_request' + uses: tj-actions/changed-files@v34 with: - list-files: json - filters: | - changed: - - '**' - - name: "Set matrix" + json: "true" + base_sha: ${{ steps.get-last-commit-with-checks.outputs.commit }} + - name: Set matrix id: set-matrix working-directory: tools env: - CHANGED_FILES: ${{ steps.filter.outputs.changed_files }} + CHANGED_FILES: ${{ toJSON(steps.get-changes.outputs.all_changed_and_modified_files) }} + LAST_FAILED_JOBS: ${{ steps.get-last-commit-with-checks.outputs.checkruns }} run: python3 -u ci_set_matrix.py diff --git a/tools/ci_changes_per_commit.py b/tools/ci_changes_per_commit.py new file mode 100644 index 0000000000..dd957b2a56 --- /dev/null +++ b/tools/ci_changes_per_commit.py @@ -0,0 +1,227 @@ +#! /usr/bin/env python3 + +# SPDX-FileCopyrightText: 2021 microDev +# +# SPDX-License-Identifier: MIT + +# GraphQL Query + +QUERY_COMMITS = """ +query ($owner: String!, $name: String!, $pullNumber: Int!, $commitsPerPage: Int!, $beforeCommit: String) { + repository(owner: $owner, name: $name) { + pullRequest(number: $pullNumber) { + commits(last: $commitsPerPage, before: $beforeCommit) { + totalCount + pageInfo { + startCursor + hasPreviousPage + } + nodes { + commit { + checkSuites(first: 3) { + nodes { + conclusion + workflowRun { + workflow { + name + } + } + id + } + totalCount + } + oid + } + } + } + } + } +} +""" + +QUERY_CHECKRUNS = """ +query ($checkSuiteID: ID!, + $afterFailedRun: String, $afterIncompleteRun: String, + $includeFailedRuns: Boolean!, $includeIncompleteRuns: Boolean!) { + node(id: $checkSuiteID) { + ... on CheckSuite { + failedRuns: checkRuns( + first: 100 + after: $afterFailedRun + filterBy: {checkType: LATEST, conclusions: [ACTION_REQUIRED, TIMED_OUT, CANCELLED, FAILURE, NEUTRAL, STARTUP_FAILURE]} + ) @include(if: $includeFailedRuns) { + nodes { + name + } + pageInfo { + endCursor + hasNextPage + } + } + incompleteRuns: checkRuns( + first: 100 + after: $afterIncompleteRun + filterBy: {checkType: LATEST, statuses: [QUEUED, IN_PROGRESS, WAITING, PENDING, REQUESTED]} + ) @include(if: $includeIncompleteRuns) { + nodes { + name + } + pageInfo { + endCursor + hasNextPage + } + } + } + } +} +""" + + +import os +import re +import json +import requests + + +query_variables_commits = { + "owner": "", + "name": "", + "pullNumber": int(os.environ["PULL"]), + "commitsPerPage": 20, + "beforeCommit": None, +} + + +query_variables_checkruns = { + "checkSuiteID": "", + "afterFailedRun": None, + "afterIncompleteRun": None, + "includeFailedRuns": True, + "includeIncompleteRuns": True, +} + + +headers = {"Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}"} + + +class Query: + def __init__(self, query, variables={}, headers={}): + self.query = query + self.variables = variables + self.headers = headers + + def paginate(self, page_info, name): + has_page = ( + page_info["hasNextPage"] if name.startswith("after") else page_info["hasPreviousPage"] + ) + if has_page: + self.variables[name] = ( + page_info["endCursor"] if name.startswith("after") else page_info["startCursor"] + ) + return has_page + + def fetch(self): + request = requests.post( + "https://api.github.com/graphql", + json={"query": self.query, "variables": self.variables}, + headers=self.headers, + ) + if request.status_code == 200: + return request.json() + else: + raise Exception("Query Failed: {}".format(request.status_code)) + + +def set_output(name, value): + if "GITHUB_OUTPUT" in os.environ: + with open(os.environ["GITHUB_OUTPUT"], "at") as f: + print(f"{name}={value}", file=f) + else: + print(f"Would set GitHub actions output {name} to '{value}'") + + +def get_commit_and_checksuite(query_commits): + commits = query_commits.fetch()["data"]["repository"]["pullRequest"]["commits"] + + if commits["totalCount"] > 0: + for commit in reversed(commits["nodes"]): + commit = commit["commit"] + commit_sha = commit["oid"] + if commit_sha == os.environ["EXCLUDE_COMMIT"]: + continue + checksuites = commit["checkSuites"] + if checksuites["totalCount"] > 0: + for checksuite in checksuites["nodes"]: + if checksuite["workflowRun"]["workflow"]["name"] == "Build CI": + return [ + commit_sha, + checksuite["id"] if checksuite["conclusion"] != "SUCCESS" else None, + ] + else: + if query_commits.paginate(commits["pageInfo"], "beforeCommit"): + return get_commit_and_checksuite(query_commits) + + return [None, None] + + +def append_runs_to_list(runs, list): + regex_matrix = re.compile("^build-[^ ]+") + regex_board = re.compile("\([^ ]+\)$") + for run in runs["nodes"]: + name = run["name"] + res_matrix = regex_matrix.search(name) + if res_matrix: + matrix = res_matrix.group() + if matrix not in list: + list[matrix] = [] + list[matrix].append(regex_board.search(name).group()[1:-1]) + + +def get_bad_checkruns(query_checkruns, list={}): + checkruns = query_checkruns.fetch()["data"]["node"] + run_types = ["failed", "incomplete"] + paginate = False + + for run_type in run_types: + run_type_camel = run_type.capitalize() + "Run" + run_type = run_type + "Runs" + + append_runs_to_list(checkruns[run_type], list) + + if query_checkruns.paginate(checkruns[run_type]["pageInfo"], "after" + run_type_camel): + query_checkruns.variables["include" + run_type_camel] = True + paginate = True + + return get_bad_checkruns(query_checkruns, list) if paginate else list + + +def main(): + query_commits = Query(QUERY_COMMITS, query_variables_commits, headers) + query_commits.variables["owner"], query_commits.variables["name"] = os.environ["REPO"].split( + "/" + ) + + commit, checksuite = get_commit_and_checksuite(query_commits) + + if checksuite is None: + if commit is None: + print("No checkSuites found -> Abort") + else: + set_output("commit", commit) + quit() + + query_checkruns = Query(QUERY_CHECKRUNS, query_variables_checkruns, headers) + query_checkruns.variables["checkSuiteID"] = checksuite + + checkruns = get_bad_checkruns(query_checkruns) + + if len(checkruns) == 0: + print("No checkRuns found -> Abort") + quit() + + set_output("commit", commit) + set_output("checkruns", json.dumps(checkruns)) + + +if __name__ == "__main__": + main() diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index f22840fad7..081cf8d4fa 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -25,7 +25,6 @@ import re import os import sys import json -import yaml import pathlib from concurrent.futures import ThreadPoolExecutor @@ -62,6 +61,7 @@ IGNORE = [ if len(sys.argv) > 1: print("Using files list on commandline") changed_files = sys.argv[1:] + last_failed_jobs = {} else: c = os.environ["CHANGED_FILES"] if c == "": @@ -69,7 +69,14 @@ else: changed_files = [] else: print("Using files list in CHANGED_FILES") - changed_files = json.loads(os.environ["CHANGED_FILES"]) + changed_files = json.loads(c) + + j = os.environ["LAST_FAILED_JOBS"] + if j == "": + print("LAST_FAILED_JOBS is in environment, but value is empty") + last_failed_jobs = {} + else: + last_failed_jobs = json.loads(j) def set_output(name, value): @@ -196,7 +203,7 @@ def set_boards_to_build(build_all): # Split boards by architecture. print("Building boards:") arch_to_boards = {"aarch": [], "arm": [], "riscv": [], "espressif": []} - for board in sorted(boards_to_build): + for board in boards_to_build: print(" ", board) port = board_to_port.get(board) # A board can appear due to its _deletion_ (rare) @@ -208,10 +215,20 @@ def set_boards_to_build(build_all): # Set the step outputs for each architecture for arch in arch_to_boards: + # Append previous failed jobs + if f"build-{arch}" in last_failed_jobs: + failed_boards = last_failed_jobs[f"build-{arch}"] + for board in failed_boards: + if not board in arch_to_boards[arch]: + arch_to_boards[arch].append(board) + # Set Output set_output(f"boards-{arch}", json.dumps(sorted(arch_to_boards[arch]))) def set_docs_to_build(build_all): + if "build-doc" in last_failed_jobs: + build_all = True + doc_match = build_all if not build_all: doc_pattern = re.compile( @@ -224,7 +241,7 @@ def set_docs_to_build(build_all): # Set the step outputs print("Building docs:", doc_match) - set_output(f"build-doc", doc_match) + set_output("build-doc", doc_match) def check_changed_files(): From be07722bbc2d2559f8ce7067b9e64686954cad3a Mon Sep 17 00:00:00 2001 From: CDario Date: Wed, 26 Oct 2022 19:57:23 +0000 Subject: [PATCH 005/357] Added board M5Stack Atom Lite --- .../boards/m5stack_atom_lite/board.c | 38 ++++++++++++++ .../boards/m5stack_atom_lite/mpconfigboard.h | 43 ++++++++++++++++ .../boards/m5stack_atom_lite/mpconfigboard.mk | 8 +++ .../espressif/boards/m5stack_atom_lite/pins.c | 49 +++++++++++++++++++ .../boards/m5stack_atom_lite/sdkconfig | 27 ++++++++++ 5 files changed, 165 insertions(+) create mode 100644 ports/espressif/boards/m5stack_atom_lite/board.c create mode 100644 ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h create mode 100644 ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk create mode 100644 ports/espressif/boards/m5stack_atom_lite/pins.c create mode 100644 ports/espressif/boards/m5stack_atom_lite/sdkconfig diff --git a/ports/espressif/boards/m5stack_atom_lite/board.c b/ports/espressif/boards/m5stack_atom_lite/board.c new file mode 100644 index 0000000000..66fa51c9fd --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_lite/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "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) { +} + +void reset_board(void) { +} diff --git a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h new file mode 100644 index 0000000000..616a156cb2 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert 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 "M5Stack Atom Lite" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO27) + +#define CIRCUITPY_BOARD_I2C (2) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO21, .sda = &pin_GPIO25}, \ + {.scl = &pin_GPIO32, .sda = &pin_GPIO26}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk new file mode 100644 index 0000000000..70b348b4f1 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x10151015 +CIRCUITPY_CREATION_ID = 0x00320003 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/m5stack_atom_lite/pins.c b/ports/espressif/boards/m5stack_atom_lite/pins.c new file mode 100644 index 0000000000..495fb3a5a0 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_lite/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +CIRCUITPY_BOARD_BUS_SINGLETON(porta_i2c, i2c, 1) + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, left side, then right side + + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A33), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_A25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SDA), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SCL), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/m5stack_atom_lite/sdkconfig b/ports/espressif/boards/m5stack_atom_lite/sdkconfig new file mode 100644 index 0000000000..8a9fb07019 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_lite/sdkconfig @@ -0,0 +1,27 @@ +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_SPIRAM_SUPPORT=n + +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="M5StaskAtomLite" +# end of LWIP + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings From 0e0c1067400cdd91ad5605f020df9e04ac3d3357 Mon Sep 17 00:00:00 2001 From: dronecz Date: Thu, 27 Oct 2022 01:06:38 +0200 Subject: [PATCH 006/357] Add Maker badge board --- .../adafruit_circuitpython_pr.md | 13 + .../.github/workflows/build.yml | 77 ++++ .../.github/workflows/failure-help-text.yml | 19 + .../.github/workflows/release.yml | 88 ++++ .../Adafruit_CircuitPython_SSD1680/.gitignore | 47 ++ .../.pre-commit-config.yaml | 42 ++ .../Adafruit_CircuitPython_SSD1680/.pylintrc | 436 ++++++++++++++++++ .../.readthedocs.yaml | 19 + .../CODE_OF_CONDUCT.md | 137 ++++++ frozen/Adafruit_CircuitPython_SSD1680/LICENSE | 21 + .../LICENSES/CC-BY-4.0.txt | 324 +++++++++++++ .../LICENSES/MIT.txt | 19 + .../LICENSES/Unlicense.txt | 20 + .../Adafruit_CircuitPython_SSD1680/README.rst | 138 ++++++ .../README.rst.license | 3 + .../adafruit_ssd1680.py | 100 ++++ .../docs/_static/favicon.ico | Bin 0 -> 4414 bytes .../docs/_static/favicon.ico.license | 3 + .../docs/api.rst | 8 + .../docs/api.rst.license | 4 + .../docs/conf.py | 194 ++++++++ .../docs/examples.rst | 8 + .../docs/examples.rst.license | 4 + .../docs/index.rst | 50 ++ .../docs/index.rst.license | 4 + .../docs/requirements.txt | 5 + .../examples/display-ruler.bmp | Bin 0 -> 360122 bytes .../examples/display-ruler.bmp.license | 2 + .../examples/ssd1680_simpletest.py | 60 +++ .../optional_requirements.txt | 3 + .../pyproject.toml | 47 ++ .../requirements.txt | 5 + .../adafruit_circuitpython_pr.md | 13 + .../.github/workflows/build.yml | 77 ++++ .../.github/workflows/failure-help-text.yml | 19 + .../.github/workflows/release.yml | 88 ++++ .../Adafruit_CircuitPython_UC8151D/.gitignore | 47 ++ .../.pre-commit-config.yaml | 42 ++ .../Adafruit_CircuitPython_UC8151D/.pylintrc | 436 ++++++++++++++++++ .../.readthedocs.yaml | 19 + .../CODE_OF_CONDUCT.md | 141 ++++++ frozen/Adafruit_CircuitPython_UC8151D/LICENSE | 21 + .../LICENSES/CC-BY-4.0.txt | 324 +++++++++++++ .../LICENSES/MIT.txt | 19 + .../LICENSES/Unlicense.txt | 20 + .../Adafruit_CircuitPython_UC8151D/README.rst | 149 ++++++ .../README.rst.license | 3 + .../adafruit_uc8151d.py | 132 ++++++ .../docs/_static/favicon.ico | Bin 0 -> 4414 bytes .../docs/_static/favicon.ico.license | 3 + .../docs/api.rst | 8 + .../docs/api.rst.license | 4 + .../docs/conf.py | 195 ++++++++ .../docs/examples.rst | 8 + .../docs/examples.rst.license | 4 + .../docs/index.rst | 51 ++ .../docs/index.rst.license | 4 + .../docs/requirements.txt | 5 + .../examples/display-ruler.bmp | Bin 0 -> 360122 bytes .../examples/display-ruler.bmp.license | 2 + .../examples/uc8151d_grayscale_test.py | 68 +++ .../examples/uc8151d_simpletest.py | 48 ++ .../optional_requirements.txt | 3 + .../pyproject.toml | 50 ++ .../requirements.txt | 6 + ports/espressif/boards/maker_badge/board.c | 63 +++ .../boards/maker_badge/mpconfigboard.h | 55 +++ .../boards/maker_badge/mpconfigboard.mk | 29 ++ ports/espressif/boards/maker_badge/pins.c | 87 ++++ 69 files changed, 4143 insertions(+) create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/build.yml create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/failure-help-text.yml create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/release.yml create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.gitignore create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.pre-commit-config.yaml create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.pylintrc create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.readthedocs.yaml create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/CODE_OF_CONDUCT.md create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/LICENSE create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/LICENSES/CC-BY-4.0.txt create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/LICENSES/MIT.txt create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/LICENSES/Unlicense.txt create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/README.rst create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/README.rst.license create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/adafruit_ssd1680.py create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/_static/favicon.ico create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/_static/favicon.ico.license create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/api.rst create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/api.rst.license create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/conf.py create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/examples.rst create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/examples.rst.license create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst.license create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/requirements.txt create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp.license create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/examples/ssd1680_simpletest.py create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/optional_requirements.txt create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/pyproject.toml create mode 100644 frozen/Adafruit_CircuitPython_SSD1680/requirements.txt create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/build.yml create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/failure-help-text.yml create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/release.yml create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.gitignore create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.pre-commit-config.yaml create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.pylintrc create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.readthedocs.yaml create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/CODE_OF_CONDUCT.md create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/LICENSE create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/LICENSES/CC-BY-4.0.txt create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/LICENSES/MIT.txt create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/LICENSES/Unlicense.txt create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/README.rst create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/README.rst.license create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/adafruit_uc8151d.py create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/_static/favicon.ico create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/_static/favicon.ico.license create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/api.rst create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/api.rst.license create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/conf.py create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/examples.rst create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/examples.rst.license create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst.license create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/requirements.txt create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp.license create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_grayscale_test.py create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_simpletest.py create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/optional_requirements.txt create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/pyproject.toml create mode 100644 frozen/Adafruit_CircuitPython_UC8151D/requirements.txt create mode 100644 ports/espressif/boards/maker_badge/board.c create mode 100644 ports/espressif/boards/maker_badge/mpconfigboard.h create mode 100644 ports/espressif/boards/maker_badge/mpconfigboard.mk create mode 100644 ports/espressif/boards/maker_badge/pins.c diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md b/frozen/Adafruit_CircuitPython_SSD1680/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md new file mode 100644 index 0000000000..8de294e68a --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2021 Adafruit Industries +# +# SPDX-License-Identifier: MIT + +Thank you for contributing! Before you submit a pull request, please read the following. + +Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html + +If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs + +Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code + +Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/build.yml b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/build.yml new file mode 100644 index 0000000000..cb2f60e36a --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/build.yml @@ -0,0 +1,77 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Build CI + +on: [pull_request, push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Translate Repo Name For Build Tools filename_prefix + id: repo-name + run: | + echo ::set-output name=repo-name::$( + echo ${{ github.repository }} | + awk -F '\/' '{ print tolower($2) }' | + tr '_' '-' + ) + - name: Set up Python 3.x + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Versions + run: | + python3 --version + - name: Checkout Current Repo + uses: actions/checkout@v1 + with: + submodules: true + - name: Checkout tools repo + uses: actions/checkout@v2 + with: + repository: adafruit/actions-ci-circuitpython-libs + path: actions-ci + - name: Install dependencies + # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.) + run: | + source actions-ci/install.sh + - name: Pip install Sphinx, pre-commit + run: | + pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit + - name: Library version + run: git describe --dirty --always --tags + - name: Setup problem matchers + uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 + - name: Pre-commit hooks + run: | + pre-commit run --all-files + - name: Build assets + run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . + - name: Archive bundles + uses: actions/upload-artifact@v2 + with: + name: bundles + path: ${{ github.workspace }}/bundles/ + - name: Build docs + working-directory: docs + run: sphinx-build -E -W -b html . _build/html + - name: Check For pyproject.toml + id: need-pypi + run: | + echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) + - name: Build Python package + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') + run: | + pip install --upgrade build twine + for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do + sed -i -e "s/0.0.0+auto.0/1.2.3/" $file; + done; + python -m build + twine check dist/* diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/failure-help-text.yml b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/failure-help-text.yml new file mode 100644 index 0000000000..0b1194f0cd --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/failure-help-text.yml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Failure help text + +on: + workflow_run: + workflows: ["Build CI"] + types: + - completed + +jobs: + post-help: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }} + steps: + - name: Post comment to help + uses: adafruit/circuitpython-action-library-ci-failed@v1 diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/release.yml b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/release.yml new file mode 100644 index 0000000000..f3a0325ba3 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/release.yml @@ -0,0 +1,88 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Release Actions + +on: + release: + types: [published] + +jobs: + upload-release-assets: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Translate Repo Name For Build Tools filename_prefix + id: repo-name + run: | + echo ::set-output name=repo-name::$( + echo ${{ github.repository }} | + awk -F '\/' '{ print tolower($2) }' | + tr '_' '-' + ) + - name: Set up Python 3.x + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Versions + run: | + python3 --version + - name: Checkout Current Repo + uses: actions/checkout@v1 + with: + submodules: true + - name: Checkout tools repo + uses: actions/checkout@v2 + with: + repository: adafruit/actions-ci-circuitpython-libs + path: actions-ci + - name: Install deps + run: | + source actions-ci/install.sh + - name: Build assets + run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . + - name: Upload Release Assets + # the 'official' actions version does not yet support dynamically + # supplying asset names to upload. @csexton's version chosen based on + # discussion in the issue below, as its the simplest to implement and + # allows for selecting files with a pattern. + # https://github.com/actions/upload-release-asset/issues/4 + #uses: actions/upload-release-asset@v1.0.1 + uses: csexton/release-asset-action@master + with: + pattern: "bundles/*" + github-token: ${{ secrets.GITHUB_TOKEN }} + + upload-pypi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Check For pyproject.toml + id: need-pypi + run: | + echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) + - name: Set up Python + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') + run: | + python -m pip install --upgrade pip + pip install --upgrade build twine + - name: Build and publish + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') + env: + TWINE_USERNAME: ${{ secrets.pypi_username }} + TWINE_PASSWORD: ${{ secrets.pypi_password }} + run: | + for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do + sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file; + done; + python -m build + twine upload dist/* diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.gitignore b/frozen/Adafruit_CircuitPython_SSD1680/.gitignore new file mode 100644 index 0000000000..544ec4a695 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/.gitignore @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +# Do not include files and directories created by your personal work environment, such as the IDE +# you use, except for those already listed here. Pull requests including changes to this file will +# not be accepted. + +# This .gitignore file contains rules for files generated by working with CircuitPython libraries, +# including building Sphinx, testing with pip, and creating a virual environment, as well as the +# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs. + +# If you find that there are files being generated on your machine that should not be included in +# your git commit, you should create a .gitignore_global file on your computer to include the +# files created by your personal setup. To do so, follow the two steps below. + +# First, create a file called .gitignore_global somewhere convenient for you, and add rules for +# the files you want to exclude from git commits. + +# Second, configure Git to use the exclude file for all Git repositories by running the +# following via commandline, replacing "path/to/your/" with the actual path to your newly created +# .gitignore_global file: +# git config --global core.excludesfile path/to/your/.gitignore_global + +# CircuitPython-specific files +*.mpy + +# Python-specific files +__pycache__ +*.pyc + +# Sphinx build-specific files +_build + +# This file results from running `pip -e install .` in a local repository +*.egg-info + +# Virtual environment-specific files +.env + +# MacOS-specific files +*.DS_Store + +# IDE-specific files +.idea +.vscode +*~ diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.pre-commit-config.yaml b/frozen/Adafruit_CircuitPython_SSD1680/.pre-commit-config.yaml new file mode 100644 index 0000000000..3343606412 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/.pre-commit-config.yaml @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# +# SPDX-License-Identifier: Unlicense + +repos: + - repo: https://github.com/python/black + rev: 22.3.0 + hooks: + - id: black + - repo: https://github.com/fsfe/reuse-tool + rev: v0.14.0 + hooks: + - id: reuse + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/pycqa/pylint + rev: v2.11.1 + hooks: + - id: pylint + name: pylint (library code) + types: [python] + args: + - --disable=consider-using-f-string + exclude: "^(docs/|examples/|tests/|setup.py$)" + - id: pylint + name: pylint (example code) + description: Run pylint rules on "examples/*.py" files + types: [python] + files: "^examples/" + args: + - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code + - id: pylint + name: pylint (test code) + description: Run pylint rules on "tests/*.py" files + types: [python] + files: "^tests/" + args: + - --disable=missing-docstring,consider-using-f-string,duplicate-code diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.pylintrc b/frozen/Adafruit_CircuitPython_SSD1680/.pylintrc new file mode 100644 index 0000000000..1f42e5de32 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/.pylintrc @@ -0,0 +1,436 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + +# Add files or directories to the ignore-list. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the ignore-list. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. +jobs=1 + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call +disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,pointless-string-statement,unspecified-encoding + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio).You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +# notes=FIXME,XXX,TODO +notes=FIXME,XXX + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules=board + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +# expected-line-ending-format= +expected-line-ending-format=LF + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma,dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=yes + +# Minimum lines number of a similarity. +min-similarity-lines=12 + + +[BASIC] + +# Naming hint for argument names +argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct argument names +argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for attribute names +attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct attribute names +attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Naming hint for class attribute names +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming hint for class names +# class-name-hint=[A-Z_][a-zA-Z0-9]+$ +class-name-hint=[A-Z_][a-zA-Z0-9_]+$ + +# Regular expression matching correct class names +# class-rgx=[A-Z_][a-zA-Z0-9]+$ +class-rgx=[A-Z_][a-zA-Z0-9_]+$ + +# Naming hint for constant names +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming hint for function names +function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct function names +function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Good variable names which should always be accepted, separated by a comma +# good-names=i,j,k,ex,Run,_ +good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_ + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming hint for inline iteration names +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming hint for method names +method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct method names +method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for module names +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Naming hint for variable names +variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct variable names +variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=optparse,tkinter.tix + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Maximum number of attributes for a class (see R0902). +# max-attributes=7 +max-attributes=11 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=1 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.readthedocs.yaml b/frozen/Adafruit_CircuitPython_SSD1680/.readthedocs.yaml new file mode 100644 index 0000000000..33c2a6108e --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/.readthedocs.yaml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +build: + os: ubuntu-20.04 + tools: + python: "3" + +python: + install: + - requirements: docs/requirements.txt + - requirements: requirements.txt diff --git a/frozen/Adafruit_CircuitPython_SSD1680/CODE_OF_CONDUCT.md b/frozen/Adafruit_CircuitPython_SSD1680/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..d885b3605a --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/CODE_OF_CONDUCT.md @@ -0,0 +1,137 @@ + +# Adafruit Community Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and leaders pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level or type of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +We are committed to providing a friendly, safe and welcoming environment for +all. + +Examples of behavior that contributes to creating a positive environment +include: + +* Be kind and courteous to others +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Collaborating with other community members +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and sexual attention or advances +* The use of inappropriate images, including in a community member's avatar +* The use of inappropriate language, including in a community member's nickname +* Any spamming, flaming, baiting or other attention-stealing behavior +* Excessive or unwelcome helping; answering outside the scope of the question + asked +* Trolling, insulting/derogatory comments, and personal or political attacks +* Promoting or spreading disinformation, lies, or conspiracy theories against + a person, group, organisation, project, or community +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate + +The goal of the standards and moderation guidelines outlined here is to build +and maintain a respectful community. We ask that you don’t just aim to be +"technically unimpeachable", but rather try to be your best self. + +We value many things beyond technical expertise, including collaboration and +supporting others within our community. Providing a positive experience for +other community members can have a much more significant impact than simply +providing the correct answer. + +## Our Responsibilities + +Project leaders are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project leaders have the right and responsibility to remove, edit, or +reject messages, comments, commits, code, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any community member for other behaviors that they deem +inappropriate, threatening, offensive, or harmful. + +## Moderation + +Instances of behaviors that violate the Adafruit Community Code of Conduct +may be reported by any member of the community. Community members are +encouraged to report these situations, including situations they witness +involving other community members. + +You may report in the following ways: + +In any situation, you may send an email to . + +On the Adafruit Discord, you may send an open message from any channel +to all Community Moderators by tagging @community moderators. You may +also send an open message from any channel, or a direct message to +@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442, +@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175. + +Email and direct message reports will be kept confidential. + +In situations on Discord where the issue is particularly egregious, possibly +illegal, requires immediate action, or violates the Discord terms of service, +you should also report the message directly to Discord. + +These are the steps for upholding our community’s standards of conduct. + +1. Any member of the community may report any situation that violates the +Adafruit Community Code of Conduct. All reports will be reviewed and +investigated. +2. If the behavior is an egregious violation, the community member who +committed the violation may be banned immediately, without warning. +3. Otherwise, moderators will first respond to such behavior with a warning. +4. Moderators follow a soft "three strikes" policy - the community member may +be given another chance, if they are receptive to the warning and change their +behavior. +5. If the community member is unreceptive or unreasonable when warned by a +moderator, or the warning goes unheeded, they may be banned for a first or +second offense. Repeated offenses will result in the community member being +banned. + +## Scope + +This Code of Conduct and the enforcement policies listed above apply to all +Adafruit Community venues. This includes but is not limited to any community +spaces (both public and private), the entire Adafruit Discord server, and +Adafruit GitHub repositories. Examples of Adafruit Community spaces include +but are not limited to meet-ups, audio chats on the Adafruit Discord, or +interaction at a conference. + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. As a community +member, you are representing our community, and are expected to behave +accordingly. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant], +version 1.4, available at +, +and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). + +For other projects adopting the Adafruit Community Code of +Conduct, please contact the maintainers of those projects for enforcement. +If you wish to use this code of conduct for your own project, consider +explicitly mentioning your moderation policy or making a copy with your +own moderation policy so as to avoid confusion. + +[Contributor Covenant]: https://www.contributor-covenant.org diff --git a/frozen/Adafruit_CircuitPython_SSD1680/LICENSE b/frozen/Adafruit_CircuitPython_SSD1680/LICENSE new file mode 100644 index 0000000000..88160406de --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Melissa LeBlanc-Williams 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. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/CC-BY-4.0.txt b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/CC-BY-4.0.txt new file mode 100644 index 0000000000..3f92dfc5fd --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/CC-BY-4.0.txt @@ -0,0 +1,324 @@ +Creative Commons Attribution 4.0 International Creative Commons Corporation +("Creative Commons") is not a law firm and does not provide legal services +or legal advice. Distribution of Creative Commons public licenses does not +create a lawyer-client or other relationship. Creative Commons makes its licenses +and related information available on an "as-is" basis. Creative Commons gives +no warranties regarding its licenses, any material licensed under their terms +and conditions, or any related information. Creative Commons disclaims all +liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions +that creators and other rights holders may use to share original works of +authorship and other material subject to copyright and certain other rights +specified in the public license below. The following considerations are for +informational purposes only, are not exhaustive, and do not form part of our +licenses. + +Considerations for licensors: Our public licenses are intended for use by +those authorized to give the public permission to use material in ways otherwise +restricted by copyright and certain other rights. Our licenses are irrevocable. +Licensors should read and understand the terms and conditions of the license +they choose before applying it. Licensors should also secure all rights necessary +before applying our licenses so that the public can reuse the material as +expected. Licensors should clearly mark any material not subject to the license. +This includes other CC-licensed material, or material used under an exception +or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors + +Considerations for the public: By using one of our public licenses, a licensor +grants the public permission to use the licensed material under specified +terms and conditions. If the licensor's permission is not necessary for any +reason–for example, because of any applicable exception or limitation to copyright–then +that use is not regulated by the license. Our licenses grant only permissions +under copyright and certain other rights that a licensor has authority to +grant. Use of the licensed material may still be restricted for other reasons, +including because others have copyright or other rights in the material. A +licensor may make special requests, such as asking that all changes be marked +or described. Although not required by our licenses, you are encouraged to +respect those requests where reasonable. More considerations for the public +: wiki.creativecommons.org/Considerations_for_licensees Creative Commons Attribution +4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to +be bound by the terms and conditions of this Creative Commons Attribution +4.0 International Public License ("Public License"). To the extent this Public +License may be interpreted as a contract, You are granted the Licensed Rights +in consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the Licensor +receives from making the Licensed Material available under these terms and +conditions. + +Section 1 – Definitions. + +a. Adapted Material means material subject to Copyright and Similar Rights +that is derived from or based upon the Licensed Material and in which the +Licensed Material is translated, altered, arranged, transformed, or otherwise +modified in a manner requiring permission under the Copyright and Similar +Rights held by the Licensor. For purposes of this Public License, where the +Licensed Material is a musical work, performance, or sound recording, Adapted +Material is always produced where the Licensed Material is synched in timed +relation with a moving image. + +b. Adapter's License means the license You apply to Your Copyright and Similar +Rights in Your contributions to Adapted Material in accordance with the terms +and conditions of this Public License. + +c. Copyright and Similar Rights means copyright and/or similar rights closely +related to copyright including, without limitation, performance, broadcast, +sound recording, and Sui Generis Database Rights, without regard to how the +rights are labeled or categorized. For purposes of this Public License, the +rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + +d. Effective Technological Measures means those measures that, in the absence +of proper authority, may not be circumvented under laws fulfilling obligations +under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, +and/or similar international agreements. + +e. Exceptions and Limitations means fair use, fair dealing, and/or any other +exception or limitation to Copyright and Similar Rights that applies to Your +use of the Licensed Material. + +f. Licensed Material means the artistic or literary work, database, or other +material to which the Licensor applied this Public License. + +g. Licensed Rights means the rights granted to You subject to the terms and +conditions of this Public License, which are limited to all Copyright and +Similar Rights that apply to Your use of the Licensed Material and that the +Licensor has authority to license. + +h. Licensor means the individual(s) or entity(ies) granting rights under this +Public License. + +i. Share means to provide material to the public by any means or process that +requires permission under the Licensed Rights, such as reproduction, public +display, public performance, distribution, dissemination, communication, or +importation, and to make material available to the public including in ways +that members of the public may access the material from a place and at a time +individually chosen by them. + +j. Sui Generis Database Rights means rights other than copyright resulting +from Directive 96/9/EC of the European Parliament and of the Council of 11 +March 1996 on the legal protection of databases, as amended and/or succeeded, +as well as other essentially equivalent rights anywhere in the world. + +k. You means the individual or entity exercising the Licensed Rights under +this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + +1. Subject to the terms and conditions of this Public License, the Licensor +hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, +irrevocable license to exercise the Licensed Rights in the Licensed Material +to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + +2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions +and Limitations apply to Your use, this Public License does not apply, and +You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + +4. Media and formats; technical modifications allowed. The Licensor authorizes +You to exercise the Licensed Rights in all media and formats whether now known +or hereafter created, and to make technical modifications necessary to do +so. The Licensor waives and/or agrees not to assert any right or authority +to forbid You from making technical modifications necessary to exercise the +Licensed Rights, including technical modifications necessary to circumvent +Effective Technological Measures. For purposes of this Public License, simply +making modifications authorized by this Section 2(a)(4) never produces Adapted +Material. + + 5. Downstream recipients. + +A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed +Material automatically receives an offer from the Licensor to exercise the +Licensed Rights under the terms and conditions of this Public License. + +B. No downstream restrictions. You may not offer or impose any additional +or different terms or conditions on, or apply any Effective Technological +Measures to, the Licensed Material if doing so restricts exercise of the Licensed +Rights by any recipient of the Licensed Material. + +6. No endorsement. Nothing in this Public License constitutes or may be construed +as permission to assert or imply that You are, or that Your use of the Licensed +Material is, connected with, or sponsored, endorsed, or granted official status +by, the Licensor or others designated to receive attribution as provided in +Section 3(a)(1)(A)(i). + + b. Other rights. + +1. Moral rights, such as the right of integrity, are not licensed under this +Public License, nor are publicity, privacy, and/or other similar personality +rights; however, to the extent possible, the Licensor waives and/or agrees +not to assert any such rights held by the Licensor to the limited extent necessary +to allow You to exercise the Licensed Rights, but not otherwise. + +2. Patent and trademark rights are not licensed under this Public License. + +3. To the extent possible, the Licensor waives any right to collect royalties +from You for the exercise of the Licensed Rights, whether directly or through +a collecting society under any voluntary or waivable statutory or compulsory +licensing scheme. In all other cases the Licensor expressly reserves any right +to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following +conditions. + + a. Attribution. + +1. If You Share the Licensed Material (including in modified form), You must: + +A. retain the following if it is supplied by the Licensor with the Licensed +Material: + +i. identification of the creator(s) of the Licensed Material and any others +designated to receive attribution, in any reasonable manner requested by the +Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + +v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + +B. indicate if You modified the Licensed Material and retain an indication +of any previous modifications; and + +C. indicate the Licensed Material is licensed under this Public License, and +include the text of, or the URI or hyperlink to, this Public License. + +2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner +based on the medium, means, and context in which You Share the Licensed Material. +For example, it may be reasonable to satisfy the conditions by providing a +URI or hyperlink to a resource that includes the required information. + +3. If requested by the Licensor, You must remove any of the information required +by Section 3(a)(1)(A) to the extent reasonably practicable. + +4. If You Share Adapted Material You produce, the Adapter's License You apply +must not prevent recipients of the Adapted Material from complying with this +Public License. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to +Your use of the Licensed Material: + +a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, +reuse, reproduce, and Share all or a substantial portion of the contents of +the database; + +b. if You include all or a substantial portion of the database contents in +a database in which You have Sui Generis Database Rights, then the database +in which You have Sui Generis Database Rights (but not its individual contents) +is Adapted Material; and + +c. You must comply with the conditions in Section 3(a) if You Share all or +a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not replace +Your obligations under this Public License where the Licensed Rights include +other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + +a. Unless otherwise separately undertaken by the Licensor, to the extent possible, +the Licensor offers the Licensed Material as-is and as-available, and makes +no representations or warranties of any kind concerning the Licensed Material, +whether express, implied, statutory, or other. This includes, without limitation, +warranties of title, merchantability, fitness for a particular purpose, non-infringement, +absence of latent or other defects, accuracy, or the presence or absence of +errors, whether or not known or discoverable. Where disclaimers of warranties +are not allowed in full or in part, this disclaimer may not apply to You. + +b. To the extent possible, in no event will the Licensor be liable to You +on any legal theory (including, without limitation, negligence) or otherwise +for any direct, special, indirect, incidental, consequential, punitive, exemplary, +or other losses, costs, expenses, or damages arising out of this Public License +or use of the Licensed Material, even if the Licensor has been advised of +the possibility of such losses, costs, expenses, or damages. Where a limitation +of liability is not allowed in full or in part, this limitation may not apply +to You. + +c. The disclaimer of warranties and limitation of liability provided above +shall be interpreted in a manner that, to the extent possible, most closely +approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + +a. This Public License applies for the term of the Copyright and Similar Rights +licensed here. However, if You fail to comply with this Public License, then +Your rights under this Public License terminate automatically. + +b. Where Your right to use the Licensed Material has terminated under Section +6(a), it reinstates: + +1. automatically as of the date the violation is cured, provided it is cured +within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + +c. For the avoidance of doubt, this Section 6(b) does not affect any right +the Licensor may have to seek remedies for Your violations of this Public +License. + +d. For the avoidance of doubt, the Licensor may also offer the Licensed Material +under separate terms or conditions or stop distributing the Licensed Material +at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + +a. The Licensor shall not be bound by any additional or different terms or +conditions communicated by You unless expressly agreed. + +b. Any arrangements, understandings, or agreements regarding the Licensed +Material not stated herein are separate from and independent of the terms +and conditions of this Public License. + +Section 8 – Interpretation. + +a. For the avoidance of doubt, this Public License does not, and shall not +be interpreted to, reduce, limit, restrict, or impose conditions on any use +of the Licensed Material that could lawfully be made without permission under +this Public License. + +b. To the extent possible, if any provision of this Public License is deemed +unenforceable, it shall be automatically reformed to the minimum extent necessary +to make it enforceable. If the provision cannot be reformed, it shall be severed +from this Public License without affecting the enforceability of the remaining +terms and conditions. + +c. No term or condition of this Public License will be waived and no failure +to comply consented to unless expressly agreed to by the Licensor. + +d. Nothing in this Public License constitutes or may be interpreted as a limitation +upon, or waiver of, any privileges and immunities that apply to the Licensor +or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative +Commons may elect to apply one of its public licenses to material it publishes +and in those instances will be considered the "Licensor." The text of the +Creative Commons public licenses is dedicated to the public domain under the +CC0 Public Domain Dedication. Except for the limited purpose of indicating +that material is shared under a Creative Commons public license or as otherwise +permitted by the Creative Commons policies published at creativecommons.org/policies, +Creative Commons does not authorize the use of the trademark "Creative Commons" +or any other trademark or logo of Creative Commons without its prior written +consent including, without limitation, in connection with any unauthorized +modifications to any of its public licenses or any other arrangements, understandings, +or agreements concerning use of licensed material. For the avoidance of doubt, +this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/MIT.txt b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/MIT.txt new file mode 100644 index 0000000000..204b93da48 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/MIT.txt @@ -0,0 +1,19 @@ +MIT License Copyright (c) + +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 (including the next +paragraph) 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. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/Unlicense.txt b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/Unlicense.txt new file mode 100644 index 0000000000..24a8f90199 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/Unlicense.txt @@ -0,0 +1,20 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or distribute +this software, either in source code form or as a compiled binary, for any +purpose, commercial or non-commercial, and by any means. + +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and +to the detriment of our heirs and successors. We intend this dedication to +be an overt act of relinquishment in perpetuity of all present and future +rights to this software under copyright law. + +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 +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. For more information, +please refer to diff --git a/frozen/Adafruit_CircuitPython_SSD1680/README.rst b/frozen/Adafruit_CircuitPython_SSD1680/README.rst new file mode 100644 index 0000000000..0ff9a3382d --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/README.rst @@ -0,0 +1,138 @@ +Introduction +============ + +.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ssd1680/badge/?version=latest + :target: https://docs.circuitpython.org/projects/ssd1680/en/latest/ + :alt: Documentation Status + + +.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg + :target: https://adafru.it/discord + :alt: Discord + + +.. image:: https://github.com/adafruit/Adafruit_CircuitPython_SSD1680/workflows/Build%20CI/badge.svg + :target: https://github.com/adafruit/Adafruit_CircuitPython_SSD1680/actions + :alt: Build Status + + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + :alt: Code Style: Black + +CircuitPython `displayio` driver for SSD1680-based ePaper displays + +Dependencies +============= +This driver depends on: + +* `Adafruit CircuitPython `_ + +Please ensure all dependencies are available on the CircuitPython filesystem. +This is easily achieved by downloading +`the Adafruit library and driver bundle `_ +or individual libraries can be installed using +`circup `_. + +* Adafruit 2.13" 250x122 Tri-Color eInk / ePaper Display with SRAM - SSD1680 Driver + +`Purchase the Breakout from the Adafruit shop `_ + +* Adafruit 2.13" HD Tri-Color eInk / ePaper Display FeatherWing - 250x122 RW Panel with SSD1680 + +`Purchase the FeatherWing from the Adafruit shop `_ + +Installing from PyPI +===================== + +On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from +PyPI `_. To install for current user: + +.. code-block:: shell + + pip3 install adafruit-circuitpython-ssd1680 + +To install system-wide (this may be required in some cases): + +.. code-block:: shell + + sudo pip3 install adafruit-circuitpython-ssd1680 + +To install in a virtual environment in your current project: + +.. code-block:: shell + + mkdir project-name && cd project-name + python3 -m venv .venv + source .venv/bin/activate + pip3 install adafruit-circuitpython-ssd1680 + +Usage Example +============= + +.. code-block:: python + + import time + import board + import displayio + import adafruit_ssd1680 + + displayio.release_displays() + + # This pinout works on a Metro M4 and may need to be altered for other boards. + spi = board.SPI() # Uses SCK and MOSI + epd_cs = board.D9 + epd_dc = board.D10 + epd_reset = board.D8 # Set to None for FeatherWing + epd_busy = board.D7 # Set to None for FeatherWing + + display_bus = displayio.FourWire( + spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000 + ) + time.sleep(1) + + display = adafruit_ssd1680.SSD1680( + display_bus, + width=250, + height=122, + busy_pin=epd_busy, + highlight_color=0xFF0000, + rotation=270, + ) + + g = displayio.Group() + + # CircuitPython 6 & 7 compatible + f = open("/display-ruler.bmp", "rb") + pic = displayio.OnDiskBitmap(f) + t = displayio.TileGrid( + pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter()) + ) + + # # CircuitPython 7 compatible only + # pic = displayio.OnDiskBitmap("/display-ruler.bmp") + # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) + + g.append(t) + + display.show(g) + + display.refresh() + print("refreshed") + + time.sleep(120) + + +Documentation +============= + +API documentation for this library can be found on `Read the Docs `_. + +For information on building library documentation, please check out `this guide `_. + +Contributing +============ + +Contributions are welcome! Please read our `Code of Conduct +`_ +before contributing to help this project stay welcoming. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/README.rst.license b/frozen/Adafruit_CircuitPython_SSD1680/README.rst.license new file mode 100644 index 0000000000..87eb036957 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/README.rst.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries +SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_SSD1680/adafruit_ssd1680.py b/frozen/Adafruit_CircuitPython_SSD1680/adafruit_ssd1680.py new file mode 100644 index 0000000000..490725fed6 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/adafruit_ssd1680.py @@ -0,0 +1,100 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: MIT +""" +`adafruit_ssd1680` +================================================================================ + +CircuitPython `displayio` driver for SSD1680-based ePaper displays + + +* Author(s): Melissa LeBlanc-Williams + +Implementation Notes +-------------------- + +**Hardware:** + +* `Adafruit 2.13" Tri-Color eInk Display Breakout `_ +* `Adafruit 2.13" Tri-Color eInk Display FeatherWing `_ + + +**Software and Dependencies:** + +* Adafruit CircuitPython firmware for the supported boards: + https://github.com/adafruit/circuitpython/releases + +""" + +import displayio + +__version__ = "0.0.0+auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1680.git" + +_START_SEQUENCE = ( + b"\x12\x80\x14" # soft reset and wait 20ms + b"\x11\x01\x03" # Ram data entry mode + b"\x3C\x01\x05" # border color + b"\x2c\x01\x36" # Set vcom voltage + b"\x03\x01\x17" # Set gate voltage + b"\x04\x03\x41\x00\x32" # Set source voltage + b"\x4e\x01\x01" # ram x count + b"\x4f\x02\x00\x00" # ram y count + b"\x01\x03\x00\x00\x00" # set display size + b"\x22\x01\xf4" # display update mode +) + +_STOP_SEQUENCE = b"\x10\x81\x01\x64" # Deep Sleep +# pylint: disable=too-few-public-methods +class SSD1680(displayio.EPaperDisplay): + r"""SSD1680 driver + + :param bus: The data bus the display is on + :param \**kwargs: + See below + + :Keyword Arguments: + * *width* (``int``) -- + Display width + * *height* (``int``) -- + Display height + * *rotation* (``int``) -- + Display rotation + """ + + def __init__(self, bus: displayio.Fourwire, **kwargs) -> None: + stop_sequence = bytearray(_STOP_SEQUENCE) + try: + bus.reset() + except RuntimeError: + # No reset pin defined, so no deep sleeping + stop_sequence = b"" + + start_sequence = bytearray(_START_SEQUENCE) + width = kwargs["width"] + height = kwargs["height"] + if "rotation" in kwargs and kwargs["rotation"] % 180 != 90: + width, height = height, width + start_sequence[29] = (width - 1) & 0xFF + start_sequence[30] = ((width - 1) >> 8) & 0xFF + + super().__init__( + bus, + start_sequence, + stop_sequence, + **kwargs, + ram_width=250, + ram_height=296, + busy_state=True, + write_black_ram_command=0x24, + write_color_ram_command=0x26, + black_bits_inverted=False, + set_column_window_command=0x44, + set_row_window_command=0x45, + set_current_column_command=0x4E, + set_current_row_command=0x4F, + refresh_display_command=0x20, + colstart=1, + always_toggle_chip_select=True, + ) diff --git a/frozen/Adafruit_CircuitPython_SSD1680/docs/_static/favicon.ico b/frozen/Adafruit_CircuitPython_SSD1680/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5aca98376a1f7e593ebd9cf41a808512c2135635 GIT binary patch literal 4414 zcmd^BX;4#F6n=SG-XmlONeGrD5E6J{RVh+e928U#MG!$jWvO+UsvWh`x&VqGNx*en zx=qox7Dqv{kPwo%fZC$dDwVpRtz{HzTkSs8QhG0)%Y=-3@Kt!4ag|JcIo?$-F|?bXVS9UDUyev>MVZQ(H8K4#;BQW-t2CPorj8^KJrMX}QK zp+e<;4ldpXz~=)2GxNy811&)gt-}Q*yVQpsxr@VMoA##{)$1~=bZ1MmjeFw?uT(`8 z^g=09<=zW%r%buwN%iHtuKSg|+r7HkT0PYN*_u9k1;^Ss-Z!RBfJ?Un4w(awqp2b3 z%+myoFis_lTlCrGx2z$0BQdh+7?!JK#9K9@Z!VrG zNj6gK5r(b4?YDOLw|DPRoN7bdP{(>GEG41YcN~4r_SUHU2hgVtUwZG@s%edC;k7Sn zC)RvEnlq~raE2mY2ko64^m1KQL}3riixh?#J{o)IT+K-RdHae2eRX91-+g!y`8^># z-zI0ir>P%Xon)!@xp-BK2bDYUB9k613NRrY6%lVjbFcQc*pRqiK~8xtkNPLxt}e?&QsTB}^!39t_%Qb)~Ukn0O%iC;zt z<&A-y;3h++)>c1br`5VFM~5(83!HKx$L+my8sW_c#@x*|*vB1yU)_dt3vH;2hqPWx zAl^6@?ipx&U7pf`a*>Yq6C85nb+B=Fnn+(id$W#WB^uHAcZVG`qg;rWB}ubvi(Y>D z$ei>REw$#xp0SHAd^|1hq&9HJ=jKK8^zTH~nk)G?yUcmTh9vUM6Y0LMw4(gYVY$D$ zGl&WY&H<)BbJ&3sYbKjx1j^=3-0Q#f^}(aP1?8^`&FUWMp|rmtpK)bLQ1Zo?^s4jqK=Lfg*9&geMGVQ z#^-*!V`fG@;H&{M9S8%+;|h&Qrxym0Ar>WT4BCVLR8cGXF=JmEYN(sNT(9vl+S|%g z8r7nXQ(95i^`=+XHo|){$vf2$?=`F$^&wFlYXyXg$B{a>$-Fp+V}+D;9k=~Xl~?C4 zAB-;RKXdUzBJE{V&d&%R>aEfFe;vxqI$0@hwVM}gFeQR@j}a>DDxR+n+-*6|_)k%% z*mSpDV|=5I9!&VC&9tD%fcVygWZV!iIo2qFtm#!*(s|@ZT33*Ad;+<|3^+yrp*;oH zBSYLV(H1zTU?2WjrCQoQW)Z>J2a=dTriuvezBmu16`tM2fm7Q@d4^iqII-xFpwHGI zn9CL}QE*1vdj2PX{PIuqOe5dracsciH6OlAZATvE8rj6ykqdIjal2 z0S0S~PwHb-5?OQ-tU-^KTG@XNrEVSvo|HIP?H;7ZhYeZkhSqh-{reE!5di;1zk$#Y zCe7rOnlzFYJ6Z#Hm$GoidKB=2HBCwm`BbZVeZY4ukmG%1uz7p2URs6c9j-Gjj^oQV zsdDb3@k2e`C$1I5ML5U0Qs0C1GAp^?!*`=|Nm(vWz3j*j*8ucum2;r0^-6Aca=Gv) zc%}&;!+_*S2tlnnJnz0EKeRmw-Y!@9ob!XQBwiv}^u9MkaXHvM=!<3YX;+2#5Cj5pp?FEK750S3BgeSDtaE^ zXUM@xoV6yBFKfzvY20V&Lr0yC + Adafruit 2.13" HD Tri-Color eInk / ePaper Display FeatherWing + +.. toctree:: + :caption: Other Links + + Download from GitHub + Download Library Bundle + CircuitPython Reference Documentation + CircuitPython Support Forum + Discord Chat + Adafruit Learning System + Adafruit Blog + Adafruit Store + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst.license b/frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst.license new file mode 100644 index 0000000000..52de478909 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries + +SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_SSD1680/docs/requirements.txt b/frozen/Adafruit_CircuitPython_SSD1680/docs/requirements.txt new file mode 100644 index 0000000000..88e67331eb --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/docs/requirements.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +sphinx>=4.0.0 diff --git a/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp b/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp new file mode 100644 index 0000000000000000000000000000000000000000..726b5e026fd30b7e5baf5c23323d159b0eb5f65d GIT binary patch literal 360122 zcmeI5J<>PHa@9vfU}y)p3NQ(_AVLn79IXQnhrqzWkgEj{fdQ^IAh~k216($MfjgY% z$@}EwoAuGByQ``{{-@)Ad$O}nW@Y`VDsR7YN29;`>woyK|MIu5>%ZVX{}KQByFdHw zw||TO{Mm2+>dXDxzsLK3{qKJJ{?E4qx4-%ifAgPyZ1%7JA_;#dE)Q`n<8kq849xm9 zbD2F6vEm7f70+r@8DW~ucsA2MQ4lBo#QIm(ELJ>ivEo_nQX1HZx8>QD_9@~x@u$>$ zRh?qRlNT$V)h?xXCnwzU>`MC-vCsM`1z%XFSn=@1if2VCfz+v*(Z7>vpCxkw&no+p zYQ>7jE>=9NUCP*_5QxW?XII*%h;6b@srK4B#fs-IRy?asWrS%qIo2tat)a&LE&O z$Ws+7vEm6xIfH=CAWv1S#EK^%vyzf0pnWA)JON&*eZ{kqk|&^jC00BEUa5V>vyzf0pnWA)JON&* zeZ{kqk|&^j^-xxS^S}QyepWn;KmUJ!%)|YExRzVmSId!q#DLmY{4!t8%KFm({O|v! z^Ml5I{Jdr;FK0DlQp$Nb0qrY(2`*t}A4|A*dQ|z!qVUmW20zD9%1c;{DqeYROF;XI zUz$r;9qU)#o$(0R%)DD(XOfBzQ0)?4+fauILnv445H z{=sc#X|6hhOl^15T*9hsRs=OWdffS$o>wkrb-rL_cmx6MD}I?)va%-Q%?ka;`jWLK`0dfUmUX9Oe>JF| zZ!^or&-A=RTXu|vhM(+7q0tE4ro&{gbL?N@Nx&wG&@{a5<);I6fn z_?`sToWXm}eQ#B3SXs0BYA?n26$<_z|LuSM{a=3nD`9_q`_-&|{~fO&fZ{%%P-3Vx3@hh^16*>$`Lcc<9iEYO_5}H!{8}Htc;KZwHH?tmScYeNS zlxtX>sqj9rU}e{RO1f<&0Cn5i?pD|uR`v;meuZD`SJua@BYpL&Uq7Po82eQU{Q6q^ zzAX8l9%lY!4Xc?mQ0_Yt(7xhVWeqF)vO;62_AC5x&pxic%KrHyp?!Mcj#t$`4_Zz% zG4(5cxuv`zfi-9Fh7&(f(i&E=U!lGDmy$Q7*rx1l^tj9et@Yt<#({|+2wB7GKw%1b zGy&}^e)*QMvfg6%KXs(aUoHEra+r%*`M5IPO+fpKU*E;7ykFr@cFd<#sX-tALzq}(^vu1@1c*Re1h;lKjAvIr>#Q**6Zd_H#{m0e5;@4;~EA$!E=3OhbBY%V-_NC~z zSR_%u;#XP9I}=!Z2Jehwv$n;otY4uj>qy>+lHtt?Mto&{yKhcyxL`4>;q@!wJqc)E z@$0gfmG!IGc49j++rFUeZc5kS5tsTEzrIr5pTOcXcz+A8%7;z>gnn?@MODV<8AP4L`?G%Ehck zm90ECC!l@BFVI!2tmk+y@~)NIl*>$jx46`=`1O_Y{sgW%gZC#>R(KUF>p6D!W`)PH zU-_4n8JGfOEu41)dY8v7~0@_zR{0mumck+Ja&B|X{Yk~l;@PolmZMgD6R>S9_ zg!dt!eZ{ZEg{-V8`9H*NkKVE{1$fM9UsmxIKf!^@3t0`Eg;L#(fc6!?A{Vlhuq% z)UV+8Hf4H#Qj?UIu$nX%rM(XU?JIsQE@$Qa3N>4U!X38tE1O8P`Kb+8Ue0RxjFj*W z1hlXCRk#nU`1h}@ersH?V^8C!He7ihR>P;JgclOfzT)BEjg@~&xxvq6w(@SQX3tmo z*AURY;yK@qm48av-?Q>hEPh7wly_q_Z>Gw;l7RLVPy24Hyg~W@I0%EE&Q#^ySWTU* zk}o5meZ`}`Eh{uG`_@vw;#c!NO8slw`L($18RVz1OnF;Y{-L!D#pXb_Wwlwk1a~H& zeZ{ZNJz3qbSpn%iS@CNv7^Zij`RL1f-lnKxdGrDpq2}6OeKS0i8jfs#u8?Pe95U1at;@s$wNpJOL?Z z5YQRqsfv|Y@dS7!_LW_H$j2%H>SO1=cj98j6B8?*m6SXI?JKe33GhnoE1s2DnZqeYJ_m1!CnWHVv`bL?poh0@_zRG_evZo`94y2Io2tat)a&LE&O z$Ws+7vEm6xIfH=CAWv1S#EK^%e)zyyADgmR9pl!DN<8DE*`=qIO8yTa5VypKO!@FM#p*D+R$xS0+NGzJ zNB$2X5VypKO!@FM#p*D+PM}kT5p9H&o=zUU`UC>LLq1`$C+8?uCjqv?4J>nSWsv_v z2wx|6>xH3JJ!swWbN zTjGiJudG?D#?l5)yFBfWe)zyyADgmR9pk1b5g0{4XOJf;R(n`| z{ma|+Uxqv}DH#GfgA66ph!xLDN)ebrKxdGrDpouzDMerg0i8jfs#x)?q!fV}1at;@ zs$#{nl2Qa_5YQRqsfrcPN=gx!K|p7arz%!FD=9@_1_7Nxo~l^!tfUly83Z1522tv@ z)m}ULjMZ085qK7X2c5yMZguHDfOzfb&)Qe2Rs?1cc+eUA>Q?GkGd975oVHlkuGfTV zDdoik9<-zE2wcePL98yMq@hJ%9)ZixAm4>}Vz--USPB>0!Jnlvw^6@jM^xcm(AU5Hmsf`2)yN%K-#5qJuL%g-R+ zg?Qy8_?NSqG%uwUfu|6-{0#D4h*wU6e>tm3^HN$7cnX2b&miB0c;zJcm$RBQFQpZM zrx3XO4DwxwS5AU|Ijc$YQd$vs3W3YdAm4>}Sr?ZN+#O@&E>2P)T|JOfNibn-NUPIJ5CGi2wJa>1y-ZHcsJ6Z?oURNZ9ZCfl2x5i zlLloT5zfd?YGRR7?UQx(!`HCt*Pyp!32g30A8u2b1QwW_%;T}ZYLpl6Mk>Jl$w;!z zM+;A~sxxZRpv)t}8QEb?EU$0><3Ij>@@M%Em%14^o7H9k5{xC#-;ilLmEu@T>ut;L zu`NN%Z-K41$?v1Mu_@^1@4u}kuR6V+y#})F4cVnn)!J~S6P}aJ3gMO(#-z)NpOjo_ zc>?AB;bUD{CaHR&{xAOGYmeF8{cgm!ug>u9Ne{A- z$^$YaPnRc2{`1YsG9az`l|z23kv30!B&Qrh`nD%bGWWYt6;z!bVn$U{b;iJ|pz7R= zih@o_QC1y@cg9q^Yz(nWze}9zx3PT0_*VUD7uXLM$DPx%JBV5#Rln!K+x}Na^=*ps zY|*G{QZ{H}2y7-Qg|wndSsJ|*@S|6iWkS+Zav%d48Is2fA^vFL{y3yxSvGxNF-!Ak zjc=PxqnxINr1J=8%i|eZf|lO`(_7CLjjE2qg-JgtOd8$$5h^c_qqtCP@IO#`zyO8I{Y-XbGNOmHQ~jPWg+o?);7t0I%^o|Nl+%^1%t>Dk=NU{{3e0mX zPc@1hu~kX(V~FG#{)i!L6f@%8T9A1*$1MX>2ZKQUY7^r-1aUKvHYQFgqm0K@J(x%p z{nc!YrVOk`#j#+QS2e1X9m`XVB1bH1sCtmC>L2LD5b3f$b8-meEc?~Toc(Z&*ca&S zG6GnObUJ2uc18-zRiiM3 zU&FtDklDJH4N)y%loLaYN~JvK3HYX(XT&0L?&2@LGCRJ7U3I$O!&8(ClHc`iR0UP1 zhrmbzdyE3JlZ+HpqpHp_A?aCg27NmXZ&o%(+`NZJd|Acn9@{fb-^$ru7Z+v?O`F;FW$ z)qr!i>u2G+LQH%ta5HLC&>7ug<2}u*n!M_afiWRzW3fo(VOeWG6n^ZSgFk&=9bTPB z2Vx6h{~x~F+*=t+GV!eS?HIeMOahNh{>~#4Vw#i$&eGFz`Y0^{lPYRrLej=slgh)g zqA%4Q=s72U$UEs1&gQ;=)nUk=8Cc&*KVC5TF)M#{VwHF8LlKW#%l6D}^p)wYN5M$1 zs*j}JWGO@GEIkM*ugyFjm6Y+ZOuOm9Vr^>92&$W*>O9%35RSC!S7#RMiLu!KSoiAP zr_*^`jrG7aMm)l>&s+mjohc*6jx7o66_XFQk)OPV^ec=tuVo?ma6U?Sl0biV#pF=p z?AYD??ul>RcG*;8;E5iXYSfg+mV~7lRalt^$;pdvR;ai7Lk1g5{i0t>yHtVg{Vi6CcTD1zGA>RzIAU0go^yT{hOFrwq`#^QcXPMj2Mtpj&MbSCz5Am3r8SgCns#O`DRMGwaH zNA;_DtMKm3*g^-|l{PXL>z+Jf94!x?2?(|H>Ql0B6G z7I$8LZ%1a71Gzx`s)Qp?hX8g?r-9&Yj7>_sN*+9(`NgqhPbH96cI;T*j?5^NyFmS_ zgdto4SKmZFmZxketS2>WsRlh3XJlf+cJA4+%Og0n9 z%AeO$zS`^YR5F$k!0OK%%QvkV6Bc8O8{A31&pCqvN6R6b30?N0Wo)|8BJ%Oob(A&|b zvA17YkBWEotM!{_{fO8|XelS}UN)J>^)fCefF+w(1Co;$->>>g3N&(s`*W6&wp8Y24Ha;%j))KUvyE6lg_Z#E)QfXwPw z*Y2oEqhn?LD~PnMl3h`gidWiE1hDj@Qk8j-JYB9yezF~H%8*w5$|1kWIQ*G(IPgvM zUNaXQ@Og7dP07YGCkBmgHyaTtKu-0mc?)`N=FKmqYI&WgvXxac$axIZOSawyy;BJ{JymKuR;6WVQOVxYI*KZt!n5Hzya^PJ^3njBukY%{M>a})^l{BewxdlMvZ-I4-xcr6P`0M3 z=Y11@*^Inz%$S$;A{)Z(Xkbu#+-yXo0NK>9W-R5?b5^@kaz1^IpHM#z_`GR)Yr+t2 zC&ONm?PybmQV90M&E2iqyU-KujVc2qcfKc zDtR6~yALVeTgr_2TJqSPsy2ou+tH>B`PHvxEaf|LrUn%s-!Z}0&%#>Dq-k36YL80J z%|=8DkXHR_(rUgVZR}Cee#h)yKMQLqlct%PQs-m-36 zp$aPr%szw2j|SqqceXLFSpnT_R^{r*GnIh;FgO+OjO03lJXNvcSxG4ZGYIGm@>Io& zXCIo&XCHklHIv&V)N@*Z}iVZ=w{0M9NUK7<>)!Vie|R(N2D*Mx}G@TH7MZO_{f<}W?N3wU2bgI4`s!mHG; zj580xlKb7W?ajlFn3T%~O5;B9QLKiqT10Ag|318cHzfo*T;4-qR3Gr>Bqqb>XvFGs*7^}Mwf^8;0xiOAvVQ38YU%N|^~yVv8z#0gU?+bo&n|zbo?Ur9 zK`d7MDr1}5j}MV@F9GWbsWYHUFc+fi>We#?p9J}@NC=muwU*_N{jr$015+`>m6{SS z<0M6mM2lP2O^r`CH0KeoQA_ zj3c`V$V7Samz3ocC z#3=FQtVT^ldEP_-+tMzZl-awE%uj;mUrSt&#!h86oKcw`A-$E4vnqr6G*K5AtpDNr^{qIA+8<-j;;R4CaZ-YG4!`uxI4lRR+_YO3khz zMu{(HHEJTt^Hu_7(?~Nl0q!_cc2BJ-KAH_#N@9;mX_;NwigLj*V^Uha7|c3dj3us(zF+RX8dwp9gb{mvczY_;{6l zIjgHCu5q75AoUr0^pj-mE2?8{kQHSrna z+TM;kobjNNxC+tsB0G6pV}>c+nX-AFD2O4Zk9SvIZg}x#*s+40j@xFPHoGLVJbqMR zxXg_dGU{=5{>?fQK!*?mlP11eX4|!?Tb}Z5 ztmh6kDzsx2r@#~jeKo}V)jN~+jHX)8nS^^|Q!i4#+6(ZB`nc=NW;{02QW*)f-bR0! zCuV59jTy`??`57lc&yHJ&{~B-9IvX(52+cZuPTQ-G1l;$yAmdhjv^*Wn)qs^eL1U@ zlbt$Ch2@EJ2mAEsy!*+cMi7JgBf* zr1@K~%F1K2vO`^J=6R}h&KOSpY6jKY=EP^a{aO{4$HYCpC*9*olE;+MX&%$NZ30gM zBZfqOv`bC$_#=!Mcw0Lb>~^c#)}&&;vLvkxGyJWphL5FwH5}<%6ZZFH|1HmCR33iB zXDO?E;7t8$@uaF%&8R{BY6jI;=G@$q5Nv7^nNnYRQpkrtR{6l0uEmrv`kE2duhwwZ zC{+T>_IY*m$2qMjRm=A8tB$4`IK;VZ9o4Ufte29AzyboTUgXWnj`M;_(h%xb2}tL0 z8LLhWdL;r22(-4k_p4Szn_XM0u;Js9-&a1a0olAG?Xqhbt7S9NKq62jP~GZq#(q@| zob9X@He=AuepMY5<@GQ1t134+Mc^<2oVaRiI*C=yY-g*s;p6uERcE+FDLtxRbIpb&_G<|ajI}pp+0dPSwOMoOQSnjzYLlJ>BCv}8I^`Y6)(OF6eGd;b)UP_s^-2Wx64-1An}WR~?$R$C zUHxj;x=1Vn>j^O3fYHpWeA(#gSMwH8nMGg-fz58PDHu{lC&{t`)UP_LpjRSr2LhYj zU{f%A7Rw4?`c;}NYTLY!cG-numW`!>S_FJcv;^`WCa}4~Hw74a>XBp$I6VCrxY@6w z*lpjOEn_MiFT;#wtkSr8tP;?2RI!|KZX(?jV00YGd8d*o;0yte?e{B};SJWw!k8@!{NKQFeE+%V3x?dSrJ9M3ODpre^ke+$^9~`Cfmg zUwJBTR(#8v&Btqlv5Zw5^sRP;X?FC)Sx0|qmmZ6a{+La6ivUTiFPnWH`=hs}cEGQG zbpYCnL*m9WJ9^^8qrbFEkHtoR%qF`?dHfNEYiv2vqbc1P17&vz7|f1gog=K|5O2|{SK!c8+cVcWKSSvqnRxFVpqQ!yKu^OhCsDndBXl% zmn}2a*MnZvX-ECHQ?Yca8auA~)mWY{$X0$oBv196CJi{a$Mx<>l+0fZX*u0*2JUvX z#&SPoE!$psF-d9pqbBC@w+jsGOV#^=(W^tKUsbVGoy%BNM}L_!o6gmVQz}bO z8C80YMV-&nAJ^V~?0wl8)c4iL?y>5`dfqOTrN>5(_fiu*{c2;L544w^ zL499+;O^>7IiApt9bX|^d^EfC*r3s0dg5C?4--{tN(iL}p6IO3w9NB?9`!4J(U-B} zOM0}@4rx56>Dbz0#)_sAw~> z(hMiC>R0^QEn~%(B&7&^6oF-DP~TS{wXZZ;5tu<> zS-+Z5{NkKqwHUaD6M;lPXD|WjJc?BZj$Vnt0s=aNJY=!rSxG4ZGYIGm@>Io&XSJ!s z|9%Ia?fdu3pW9|O2|k3t*N)M}5fCem6Q%lTMa{p)EFvFie6p>bz^}eo?P6t}s1;&w zz42NKbP28Q%A$nlD|I>`fL9EEt_YK3)<8!8L>9Li^iivk$M-Q>L$NZjT zuhAd0^>*(lFVII6m`;2&J9*;c3#QLcAx^wXrlc1`_<>%gBw3xAHHP@UsE;dOCWQE) zqij#O*XS3}db@X&cj#L*%%9%I$9GKsz$~g{kSD@{9Ul*j^4t)cyWdMPRnM{c`X~%- z)5NFf;VYc1lPTRE*-)ZdjM_lMee>l%rUL=yV>@)c-Hcg`(sPvp4^obct z4x64Rc;b`~*BmEq_NFHa4v+ijKoBqpcDK1yJ!m!d^Z9;7eqZj1#?Q-N{u%|lY-FkG zqrYWW1NS;(a>U}%F3`uwQ?hcszjBXf za1V@_E!t7T+tnfX@Wsk!Rl68Y8cwVdkj|r6b>Q@0MRd{jC^+ph4{U$+dgG%edvZ0! ziU%lGJgcMxI;ZDGRr4+Upk@UKEg*@H9>r?c9?-tpg)52;UA)J)%j|o8wP|1R8$hg{ z&g!0LFj4hw2E*;7S@3vIRu=;4Fc+&1ob*bp5|Ga0Jz1rK;fsEF-`VbjzY{`uF<8>goHcUw?mn`{!4&k*!$$ zN+UjHTdX1xouglAV0Sb>8`^Kaa&!W}-^OvWt=LFJoPVX!+>nro)rYg{v<~f!58oSc T`pMSbh(J1r2r{u6#p?e9C4JK7 literal 0 HcmV?d00001 diff --git a/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp.license b/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp.license new file mode 100644 index 0000000000..a784acfa32 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp.license @@ -0,0 +1,2 @@ +# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries +# SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_SSD1680/examples/ssd1680_simpletest.py b/frozen/Adafruit_CircuitPython_SSD1680/examples/ssd1680_simpletest.py new file mode 100644 index 0000000000..48a4d4d8bd --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/examples/ssd1680_simpletest.py @@ -0,0 +1,60 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +"""Simple test script for 2.13" 250x122 tri-color display. +Supported products: + * Adafruit 2.13" Tri-Color eInk Display Breakout + * https://www.adafruit.com/product/4947 + * Adafruit 2.13" Tri-Color eInk Display FeatherWing + * https://www.adafruit.com/product/4814 +""" + +import time +import board +import displayio +import adafruit_ssd1680 + +displayio.release_displays() + +# This pinout works on a Metro M4 and may need to be altered for other boards. +spi = board.SPI() # Uses SCK and MOSI +epd_cs = board.D9 +epd_dc = board.D10 +epd_reset = board.D8 # Set to None for FeatherWing +epd_busy = board.D7 # Set to None for FeatherWing + +display_bus = displayio.FourWire( + spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000 +) +time.sleep(1) + +display = adafruit_ssd1680.SSD1680( + display_bus, + width=250, + height=122, + busy_pin=epd_busy, + highlight_color=0xFF0000, + rotation=270, +) + +g = displayio.Group() + +with open("/display-ruler.bmp", "rb") as f: + pic = displayio.OnDiskBitmap(f) + # CircuitPython 6 & 7 compatible + t = displayio.TileGrid( + pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter()) + ) + # CircuitPython 7 compatible only + # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) + g.append(t) + + display.show(g) + + display.refresh() + + print("refreshed") + + time.sleep(120) diff --git a/frozen/Adafruit_CircuitPython_SSD1680/optional_requirements.txt b/frozen/Adafruit_CircuitPython_SSD1680/optional_requirements.txt new file mode 100644 index 0000000000..d4e27c4d74 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/optional_requirements.txt @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense diff --git a/frozen/Adafruit_CircuitPython_SSD1680/pyproject.toml b/frozen/Adafruit_CircuitPython_SSD1680/pyproject.toml new file mode 100644 index 0000000000..b36b2d7afb --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/pyproject.toml @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +[build-system] +requires = [ + "setuptools", + "wheel", + "setuptools-scm", +] + +[project] +name = "adafruit-circuitpython-ssd1680" +description = "CircuitPython `displayio` drivers for SSD1680-based ePaper displays" +version = "0.0.0+auto.0" +readme = "README.rst" +authors = [ + {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} +] +urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1680"} +keywords = [ + "adafruit", + "blinka", + "circuitpython", + "micropython", + "ssd1680", + "displayio", + "epd", + "epaper", +] +license = {text = "MIT"} +classifiers = [ + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Embedded Systems", + "Topic :: System :: Hardware", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", +] +dynamic = ["dependencies", "optional-dependencies"] + +[tool.setuptools] +py-modules = ["adafruit_ssd1680"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} +optional-dependencies = {optional = {file = ["optional_requirements.txt"]}} diff --git a/frozen/Adafruit_CircuitPython_SSD1680/requirements.txt b/frozen/Adafruit_CircuitPython_SSD1680/requirements.txt new file mode 100644 index 0000000000..7a984a4739 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680/requirements.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +Adafruit-Blinka diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md b/frozen/Adafruit_CircuitPython_UC8151D/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md new file mode 100644 index 0000000000..8de294e68a --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2021 Adafruit Industries +# +# SPDX-License-Identifier: MIT + +Thank you for contributing! Before you submit a pull request, please read the following. + +Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html + +If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs + +Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code + +Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/build.yml b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/build.yml new file mode 100644 index 0000000000..cb2f60e36a --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/build.yml @@ -0,0 +1,77 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Build CI + +on: [pull_request, push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Translate Repo Name For Build Tools filename_prefix + id: repo-name + run: | + echo ::set-output name=repo-name::$( + echo ${{ github.repository }} | + awk -F '\/' '{ print tolower($2) }' | + tr '_' '-' + ) + - name: Set up Python 3.x + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Versions + run: | + python3 --version + - name: Checkout Current Repo + uses: actions/checkout@v1 + with: + submodules: true + - name: Checkout tools repo + uses: actions/checkout@v2 + with: + repository: adafruit/actions-ci-circuitpython-libs + path: actions-ci + - name: Install dependencies + # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.) + run: | + source actions-ci/install.sh + - name: Pip install Sphinx, pre-commit + run: | + pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit + - name: Library version + run: git describe --dirty --always --tags + - name: Setup problem matchers + uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 + - name: Pre-commit hooks + run: | + pre-commit run --all-files + - name: Build assets + run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . + - name: Archive bundles + uses: actions/upload-artifact@v2 + with: + name: bundles + path: ${{ github.workspace }}/bundles/ + - name: Build docs + working-directory: docs + run: sphinx-build -E -W -b html . _build/html + - name: Check For pyproject.toml + id: need-pypi + run: | + echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) + - name: Build Python package + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') + run: | + pip install --upgrade build twine + for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do + sed -i -e "s/0.0.0+auto.0/1.2.3/" $file; + done; + python -m build + twine check dist/* diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/failure-help-text.yml b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/failure-help-text.yml new file mode 100644 index 0000000000..0b1194f0cd --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/failure-help-text.yml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Failure help text + +on: + workflow_run: + workflows: ["Build CI"] + types: + - completed + +jobs: + post-help: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }} + steps: + - name: Post comment to help + uses: adafruit/circuitpython-action-library-ci-failed@v1 diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/release.yml b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/release.yml new file mode 100644 index 0000000000..f3a0325ba3 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/release.yml @@ -0,0 +1,88 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Release Actions + +on: + release: + types: [published] + +jobs: + upload-release-assets: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Translate Repo Name For Build Tools filename_prefix + id: repo-name + run: | + echo ::set-output name=repo-name::$( + echo ${{ github.repository }} | + awk -F '\/' '{ print tolower($2) }' | + tr '_' '-' + ) + - name: Set up Python 3.x + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Versions + run: | + python3 --version + - name: Checkout Current Repo + uses: actions/checkout@v1 + with: + submodules: true + - name: Checkout tools repo + uses: actions/checkout@v2 + with: + repository: adafruit/actions-ci-circuitpython-libs + path: actions-ci + - name: Install deps + run: | + source actions-ci/install.sh + - name: Build assets + run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . + - name: Upload Release Assets + # the 'official' actions version does not yet support dynamically + # supplying asset names to upload. @csexton's version chosen based on + # discussion in the issue below, as its the simplest to implement and + # allows for selecting files with a pattern. + # https://github.com/actions/upload-release-asset/issues/4 + #uses: actions/upload-release-asset@v1.0.1 + uses: csexton/release-asset-action@master + with: + pattern: "bundles/*" + github-token: ${{ secrets.GITHUB_TOKEN }} + + upload-pypi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Check For pyproject.toml + id: need-pypi + run: | + echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) + - name: Set up Python + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') + run: | + python -m pip install --upgrade pip + pip install --upgrade build twine + - name: Build and publish + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') + env: + TWINE_USERNAME: ${{ secrets.pypi_username }} + TWINE_PASSWORD: ${{ secrets.pypi_password }} + run: | + for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do + sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file; + done; + python -m build + twine upload dist/* diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.gitignore b/frozen/Adafruit_CircuitPython_UC8151D/.gitignore new file mode 100644 index 0000000000..544ec4a695 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/.gitignore @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +# Do not include files and directories created by your personal work environment, such as the IDE +# you use, except for those already listed here. Pull requests including changes to this file will +# not be accepted. + +# This .gitignore file contains rules for files generated by working with CircuitPython libraries, +# including building Sphinx, testing with pip, and creating a virual environment, as well as the +# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs. + +# If you find that there are files being generated on your machine that should not be included in +# your git commit, you should create a .gitignore_global file on your computer to include the +# files created by your personal setup. To do so, follow the two steps below. + +# First, create a file called .gitignore_global somewhere convenient for you, and add rules for +# the files you want to exclude from git commits. + +# Second, configure Git to use the exclude file for all Git repositories by running the +# following via commandline, replacing "path/to/your/" with the actual path to your newly created +# .gitignore_global file: +# git config --global core.excludesfile path/to/your/.gitignore_global + +# CircuitPython-specific files +*.mpy + +# Python-specific files +__pycache__ +*.pyc + +# Sphinx build-specific files +_build + +# This file results from running `pip -e install .` in a local repository +*.egg-info + +# Virtual environment-specific files +.env + +# MacOS-specific files +*.DS_Store + +# IDE-specific files +.idea +.vscode +*~ diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.pre-commit-config.yaml b/frozen/Adafruit_CircuitPython_UC8151D/.pre-commit-config.yaml new file mode 100644 index 0000000000..3343606412 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/.pre-commit-config.yaml @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# +# SPDX-License-Identifier: Unlicense + +repos: + - repo: https://github.com/python/black + rev: 22.3.0 + hooks: + - id: black + - repo: https://github.com/fsfe/reuse-tool + rev: v0.14.0 + hooks: + - id: reuse + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/pycqa/pylint + rev: v2.11.1 + hooks: + - id: pylint + name: pylint (library code) + types: [python] + args: + - --disable=consider-using-f-string + exclude: "^(docs/|examples/|tests/|setup.py$)" + - id: pylint + name: pylint (example code) + description: Run pylint rules on "examples/*.py" files + types: [python] + files: "^examples/" + args: + - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code + - id: pylint + name: pylint (test code) + description: Run pylint rules on "tests/*.py" files + types: [python] + files: "^tests/" + args: + - --disable=missing-docstring,consider-using-f-string,duplicate-code diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.pylintrc b/frozen/Adafruit_CircuitPython_UC8151D/.pylintrc new file mode 100644 index 0000000000..1f42e5de32 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/.pylintrc @@ -0,0 +1,436 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + +# Add files or directories to the ignore-list. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the ignore-list. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. +jobs=1 + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call +disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,pointless-string-statement,unspecified-encoding + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio).You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +# notes=FIXME,XXX,TODO +notes=FIXME,XXX + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules=board + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +# expected-line-ending-format= +expected-line-ending-format=LF + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma,dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=yes + +# Minimum lines number of a similarity. +min-similarity-lines=12 + + +[BASIC] + +# Naming hint for argument names +argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct argument names +argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for attribute names +attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct attribute names +attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Naming hint for class attribute names +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming hint for class names +# class-name-hint=[A-Z_][a-zA-Z0-9]+$ +class-name-hint=[A-Z_][a-zA-Z0-9_]+$ + +# Regular expression matching correct class names +# class-rgx=[A-Z_][a-zA-Z0-9]+$ +class-rgx=[A-Z_][a-zA-Z0-9_]+$ + +# Naming hint for constant names +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming hint for function names +function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct function names +function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Good variable names which should always be accepted, separated by a comma +# good-names=i,j,k,ex,Run,_ +good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_ + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming hint for inline iteration names +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming hint for method names +method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct method names +method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for module names +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Naming hint for variable names +variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct variable names +variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=optparse,tkinter.tix + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Maximum number of attributes for a class (see R0902). +# max-attributes=7 +max-attributes=11 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=1 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.readthedocs.yaml b/frozen/Adafruit_CircuitPython_UC8151D/.readthedocs.yaml new file mode 100644 index 0000000000..33c2a6108e --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/.readthedocs.yaml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +build: + os: ubuntu-20.04 + tools: + python: "3" + +python: + install: + - requirements: docs/requirements.txt + - requirements: requirements.txt diff --git a/frozen/Adafruit_CircuitPython_UC8151D/CODE_OF_CONDUCT.md b/frozen/Adafruit_CircuitPython_UC8151D/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..01a7515796 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/CODE_OF_CONDUCT.md @@ -0,0 +1,141 @@ + +# Adafruit Community Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and leaders pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level or type of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +We are committed to providing a friendly, safe and welcoming environment for +all. + +Examples of behavior that contributes to creating a positive environment +include: + +* Be kind and courteous to others +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Collaborating with other community members +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and sexual attention or advances +* The use of inappropriate images, including in a community member's avatar +* The use of inappropriate language, including in a community member's nickname +* Any spamming, flaming, baiting or other attention-stealing behavior +* Excessive or unwelcome helping; answering outside the scope of the question + asked +* Discussion or promotion of activities or projects that intend or pose a risk of + significant harm +* Trolling, insulting/derogatory comments, and personal or political attacks +* Promoting or spreading disinformation, lies, or conspiracy theories against + a person, group, organisation, project, or community +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate + +The goal of the standards and moderation guidelines outlined here is to build +and maintain a respectful community. We ask that you don’t just aim to be +"technically unimpeachable", but rather try to be your best self. + +We value many things beyond technical expertise, including collaboration and +supporting others within our community. Providing a positive experience for +other community members can have a much more significant impact than simply +providing the correct answer. + +## Our Responsibilities + +Project leaders are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project leaders have the right and responsibility to remove, edit, or +reject messages, comments, commits, code, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any community member for other behaviors that they deem +inappropriate, threatening, offensive, or harmful. + +## Moderation + +Instances of behaviors that violate the Adafruit Community Code of Conduct +may be reported by any member of the community. Community members are +encouraged to report these situations, including situations they witness +involving other community members. + +You may report in the following ways: + +In any situation, you may email . + +On the Adafruit Discord, you may send an open message from any channel +to all Community Moderators by tagging @community moderators. You may +also send an open message from any channel, or a direct message to +any Community Moderator. + +Email and direct message reports will be kept confidential. + +In situations on Discord where the issue is particularly offensive, possibly +illegal, requires immediate action, or violates the Discord terms of service, +you should also report the message directly to [Discord](https://discord.com/safety). + +These are the steps for upholding our community’s standards of conduct. + +1. Any member of the community may report any situation that violates the + CircuitPython Community Code of Conduct. All reports will be reviewed and + investigated. +2. If the behavior is a severe violation, the community member who + committed the violation may be banned immediately, without warning. +3. Otherwise, moderators will first respond to such behavior with a warning. +4. Moderators follow a soft "three strikes" policy - the community member may + be given another chance, if they are receptive to the warning and change their + behavior. +5. If the community member is unreceptive or unreasonable when warned by a + moderator, or the warning goes unheeded, they may be banned for a first or + second offense. Repeated offenses will result in the community member being + banned. +6. Disciplinary actions (warnings, bans, etc) for Code of Conduct violations apply + to the platform where the violation occurred. However, depending on the severity + of the violation, the disciplinary action may be applied across Adafruit's other + community platforms. For example, a severe violation on the Adafruit Discord + server may result in a ban on not only the Adafruit Discord server, but also on + the Adafruit GitHub organisation, Adafruit Forums, Adafruit Twitter, etc. + +## Scope + +This Code of Conduct and the enforcement policies listed above apply to all +Adafruit Community venues. This includes but is not limited to any community +spaces (both public and private), the entire Adafruit Discord server, and +Adafruit GitHub repositories. Examples of Adafruit Community spaces include +but are not limited to meet-ups, audio chats on the Adafruit Discord, or +interaction at a conference. + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. As a community +member, you are representing our community, and are expected to behave +accordingly. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), +version 1.4, available on [contributor-covenant.org](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), +and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). + +For other projects adopting the Adafruit Community Code of +Conduct, please contact the maintainers of those projects for enforcement. +If you wish to use this code of conduct for your own project, consider +explicitly mentioning your moderation policy or making a copy with your +own moderation policy so as to avoid confusion. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/LICENSE b/frozen/Adafruit_CircuitPython_UC8151D/LICENSE new file mode 100644 index 0000000000..88160406de --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Melissa LeBlanc-Williams 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. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/CC-BY-4.0.txt b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/CC-BY-4.0.txt new file mode 100644 index 0000000000..3f92dfc5fd --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/CC-BY-4.0.txt @@ -0,0 +1,324 @@ +Creative Commons Attribution 4.0 International Creative Commons Corporation +("Creative Commons") is not a law firm and does not provide legal services +or legal advice. Distribution of Creative Commons public licenses does not +create a lawyer-client or other relationship. Creative Commons makes its licenses +and related information available on an "as-is" basis. Creative Commons gives +no warranties regarding its licenses, any material licensed under their terms +and conditions, or any related information. Creative Commons disclaims all +liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions +that creators and other rights holders may use to share original works of +authorship and other material subject to copyright and certain other rights +specified in the public license below. The following considerations are for +informational purposes only, are not exhaustive, and do not form part of our +licenses. + +Considerations for licensors: Our public licenses are intended for use by +those authorized to give the public permission to use material in ways otherwise +restricted by copyright and certain other rights. Our licenses are irrevocable. +Licensors should read and understand the terms and conditions of the license +they choose before applying it. Licensors should also secure all rights necessary +before applying our licenses so that the public can reuse the material as +expected. Licensors should clearly mark any material not subject to the license. +This includes other CC-licensed material, or material used under an exception +or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors + +Considerations for the public: By using one of our public licenses, a licensor +grants the public permission to use the licensed material under specified +terms and conditions. If the licensor's permission is not necessary for any +reason–for example, because of any applicable exception or limitation to copyright–then +that use is not regulated by the license. Our licenses grant only permissions +under copyright and certain other rights that a licensor has authority to +grant. Use of the licensed material may still be restricted for other reasons, +including because others have copyright or other rights in the material. A +licensor may make special requests, such as asking that all changes be marked +or described. Although not required by our licenses, you are encouraged to +respect those requests where reasonable. More considerations for the public +: wiki.creativecommons.org/Considerations_for_licensees Creative Commons Attribution +4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to +be bound by the terms and conditions of this Creative Commons Attribution +4.0 International Public License ("Public License"). To the extent this Public +License may be interpreted as a contract, You are granted the Licensed Rights +in consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the Licensor +receives from making the Licensed Material available under these terms and +conditions. + +Section 1 – Definitions. + +a. Adapted Material means material subject to Copyright and Similar Rights +that is derived from or based upon the Licensed Material and in which the +Licensed Material is translated, altered, arranged, transformed, or otherwise +modified in a manner requiring permission under the Copyright and Similar +Rights held by the Licensor. For purposes of this Public License, where the +Licensed Material is a musical work, performance, or sound recording, Adapted +Material is always produced where the Licensed Material is synched in timed +relation with a moving image. + +b. Adapter's License means the license You apply to Your Copyright and Similar +Rights in Your contributions to Adapted Material in accordance with the terms +and conditions of this Public License. + +c. Copyright and Similar Rights means copyright and/or similar rights closely +related to copyright including, without limitation, performance, broadcast, +sound recording, and Sui Generis Database Rights, without regard to how the +rights are labeled or categorized. For purposes of this Public License, the +rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + +d. Effective Technological Measures means those measures that, in the absence +of proper authority, may not be circumvented under laws fulfilling obligations +under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, +and/or similar international agreements. + +e. Exceptions and Limitations means fair use, fair dealing, and/or any other +exception or limitation to Copyright and Similar Rights that applies to Your +use of the Licensed Material. + +f. Licensed Material means the artistic or literary work, database, or other +material to which the Licensor applied this Public License. + +g. Licensed Rights means the rights granted to You subject to the terms and +conditions of this Public License, which are limited to all Copyright and +Similar Rights that apply to Your use of the Licensed Material and that the +Licensor has authority to license. + +h. Licensor means the individual(s) or entity(ies) granting rights under this +Public License. + +i. Share means to provide material to the public by any means or process that +requires permission under the Licensed Rights, such as reproduction, public +display, public performance, distribution, dissemination, communication, or +importation, and to make material available to the public including in ways +that members of the public may access the material from a place and at a time +individually chosen by them. + +j. Sui Generis Database Rights means rights other than copyright resulting +from Directive 96/9/EC of the European Parliament and of the Council of 11 +March 1996 on the legal protection of databases, as amended and/or succeeded, +as well as other essentially equivalent rights anywhere in the world. + +k. You means the individual or entity exercising the Licensed Rights under +this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + +1. Subject to the terms and conditions of this Public License, the Licensor +hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, +irrevocable license to exercise the Licensed Rights in the Licensed Material +to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + +2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions +and Limitations apply to Your use, this Public License does not apply, and +You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + +4. Media and formats; technical modifications allowed. The Licensor authorizes +You to exercise the Licensed Rights in all media and formats whether now known +or hereafter created, and to make technical modifications necessary to do +so. The Licensor waives and/or agrees not to assert any right or authority +to forbid You from making technical modifications necessary to exercise the +Licensed Rights, including technical modifications necessary to circumvent +Effective Technological Measures. For purposes of this Public License, simply +making modifications authorized by this Section 2(a)(4) never produces Adapted +Material. + + 5. Downstream recipients. + +A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed +Material automatically receives an offer from the Licensor to exercise the +Licensed Rights under the terms and conditions of this Public License. + +B. No downstream restrictions. You may not offer or impose any additional +or different terms or conditions on, or apply any Effective Technological +Measures to, the Licensed Material if doing so restricts exercise of the Licensed +Rights by any recipient of the Licensed Material. + +6. No endorsement. Nothing in this Public License constitutes or may be construed +as permission to assert or imply that You are, or that Your use of the Licensed +Material is, connected with, or sponsored, endorsed, or granted official status +by, the Licensor or others designated to receive attribution as provided in +Section 3(a)(1)(A)(i). + + b. Other rights. + +1. Moral rights, such as the right of integrity, are not licensed under this +Public License, nor are publicity, privacy, and/or other similar personality +rights; however, to the extent possible, the Licensor waives and/or agrees +not to assert any such rights held by the Licensor to the limited extent necessary +to allow You to exercise the Licensed Rights, but not otherwise. + +2. Patent and trademark rights are not licensed under this Public License. + +3. To the extent possible, the Licensor waives any right to collect royalties +from You for the exercise of the Licensed Rights, whether directly or through +a collecting society under any voluntary or waivable statutory or compulsory +licensing scheme. In all other cases the Licensor expressly reserves any right +to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following +conditions. + + a. Attribution. + +1. If You Share the Licensed Material (including in modified form), You must: + +A. retain the following if it is supplied by the Licensor with the Licensed +Material: + +i. identification of the creator(s) of the Licensed Material and any others +designated to receive attribution, in any reasonable manner requested by the +Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + +v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + +B. indicate if You modified the Licensed Material and retain an indication +of any previous modifications; and + +C. indicate the Licensed Material is licensed under this Public License, and +include the text of, or the URI or hyperlink to, this Public License. + +2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner +based on the medium, means, and context in which You Share the Licensed Material. +For example, it may be reasonable to satisfy the conditions by providing a +URI or hyperlink to a resource that includes the required information. + +3. If requested by the Licensor, You must remove any of the information required +by Section 3(a)(1)(A) to the extent reasonably practicable. + +4. If You Share Adapted Material You produce, the Adapter's License You apply +must not prevent recipients of the Adapted Material from complying with this +Public License. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to +Your use of the Licensed Material: + +a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, +reuse, reproduce, and Share all or a substantial portion of the contents of +the database; + +b. if You include all or a substantial portion of the database contents in +a database in which You have Sui Generis Database Rights, then the database +in which You have Sui Generis Database Rights (but not its individual contents) +is Adapted Material; and + +c. You must comply with the conditions in Section 3(a) if You Share all or +a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not replace +Your obligations under this Public License where the Licensed Rights include +other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + +a. Unless otherwise separately undertaken by the Licensor, to the extent possible, +the Licensor offers the Licensed Material as-is and as-available, and makes +no representations or warranties of any kind concerning the Licensed Material, +whether express, implied, statutory, or other. This includes, without limitation, +warranties of title, merchantability, fitness for a particular purpose, non-infringement, +absence of latent or other defects, accuracy, or the presence or absence of +errors, whether or not known or discoverable. Where disclaimers of warranties +are not allowed in full or in part, this disclaimer may not apply to You. + +b. To the extent possible, in no event will the Licensor be liable to You +on any legal theory (including, without limitation, negligence) or otherwise +for any direct, special, indirect, incidental, consequential, punitive, exemplary, +or other losses, costs, expenses, or damages arising out of this Public License +or use of the Licensed Material, even if the Licensor has been advised of +the possibility of such losses, costs, expenses, or damages. Where a limitation +of liability is not allowed in full or in part, this limitation may not apply +to You. + +c. The disclaimer of warranties and limitation of liability provided above +shall be interpreted in a manner that, to the extent possible, most closely +approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + +a. This Public License applies for the term of the Copyright and Similar Rights +licensed here. However, if You fail to comply with this Public License, then +Your rights under this Public License terminate automatically. + +b. Where Your right to use the Licensed Material has terminated under Section +6(a), it reinstates: + +1. automatically as of the date the violation is cured, provided it is cured +within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + +c. For the avoidance of doubt, this Section 6(b) does not affect any right +the Licensor may have to seek remedies for Your violations of this Public +License. + +d. For the avoidance of doubt, the Licensor may also offer the Licensed Material +under separate terms or conditions or stop distributing the Licensed Material +at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + +a. The Licensor shall not be bound by any additional or different terms or +conditions communicated by You unless expressly agreed. + +b. Any arrangements, understandings, or agreements regarding the Licensed +Material not stated herein are separate from and independent of the terms +and conditions of this Public License. + +Section 8 – Interpretation. + +a. For the avoidance of doubt, this Public License does not, and shall not +be interpreted to, reduce, limit, restrict, or impose conditions on any use +of the Licensed Material that could lawfully be made without permission under +this Public License. + +b. To the extent possible, if any provision of this Public License is deemed +unenforceable, it shall be automatically reformed to the minimum extent necessary +to make it enforceable. If the provision cannot be reformed, it shall be severed +from this Public License without affecting the enforceability of the remaining +terms and conditions. + +c. No term or condition of this Public License will be waived and no failure +to comply consented to unless expressly agreed to by the Licensor. + +d. Nothing in this Public License constitutes or may be interpreted as a limitation +upon, or waiver of, any privileges and immunities that apply to the Licensor +or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative +Commons may elect to apply one of its public licenses to material it publishes +and in those instances will be considered the "Licensor." The text of the +Creative Commons public licenses is dedicated to the public domain under the +CC0 Public Domain Dedication. Except for the limited purpose of indicating +that material is shared under a Creative Commons public license or as otherwise +permitted by the Creative Commons policies published at creativecommons.org/policies, +Creative Commons does not authorize the use of the trademark "Creative Commons" +or any other trademark or logo of Creative Commons without its prior written +consent including, without limitation, in connection with any unauthorized +modifications to any of its public licenses or any other arrangements, understandings, +or agreements concerning use of licensed material. For the avoidance of doubt, +this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/MIT.txt b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/MIT.txt new file mode 100644 index 0000000000..204b93da48 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/MIT.txt @@ -0,0 +1,19 @@ +MIT License Copyright (c) + +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 (including the next +paragraph) 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. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/Unlicense.txt b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/Unlicense.txt new file mode 100644 index 0000000000..24a8f90199 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/Unlicense.txt @@ -0,0 +1,20 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or distribute +this software, either in source code form or as a compiled binary, for any +purpose, commercial or non-commercial, and by any means. + +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and +to the detriment of our heirs and successors. We intend this dedication to +be an overt act of relinquishment in perpetuity of all present and future +rights to this software under copyright law. + +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 +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. For more information, +please refer to diff --git a/frozen/Adafruit_CircuitPython_UC8151D/README.rst b/frozen/Adafruit_CircuitPython_UC8151D/README.rst new file mode 100644 index 0000000000..08efe2f99b --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/README.rst @@ -0,0 +1,149 @@ +Introduction +============ + + +.. image:: https://readthedocs.org/projects/adafruit-circuitpython-uc8151d/badge/?version=latest + :target: https://docs.circuitpython.org/projects/uc8151d/en/latest/ + :alt: Documentation Status + + +.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg + :target: https://adafru.it/discord + :alt: Discord + + +.. image:: https://github.com/adafruit/Adafruit_CircuitPython_UC8151D/workflows/Build%20CI/badge.svg + :target: https://github.com/adafruit/Adafruit_CircuitPython_UC8151D/actions + :alt: Build Status + + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + :alt: Code Style: Black + +CircuitPython `displayio` driver for US8151D-based ePaper displays + + +Dependencies +============= +This driver depends on: + +* `Adafruit CircuitPython `_ + +Please ensure all dependencies are available on the CircuitPython filesystem. +This is easily achieved by downloading +`the Adafruit library and driver bundle `_ +or individual libraries can be installed using +`circup `_. + +Adafruit 2.9" Flexible 296x128 Monochrome eInk / ePaper Display + +`Purchase one from the Adafruit shop `_ + + +Installing from PyPI +===================== + +On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from +PyPI `_. +To install for current user: + +.. code-block:: shell + + pip3 install adafruit-circuitpython-uc8151d + +To install system-wide (this may be required in some cases): + +.. code-block:: shell + + sudo pip3 install adafruit-circuitpython-uc8151d + +To install in a virtual environment in your current project: + +.. code-block:: shell + + mkdir project-name && cd project-name + python3 -m venv .venv + source .venv/bin/activate + pip3 install adafruit-circuitpython-uc8151d + + + +Installing to a Connected CircuitPython Device with Circup +========================================================== + +Make sure that you have ``circup`` installed in your Python environment. +Install it with the following command if necessary: + +.. code-block:: shell + + pip3 install circup + +With ``circup`` installed and your CircuitPython device connected use the +following command to install: + +.. code-block:: shell + + circup install uc8151d + +Or the following command to update an existing version: + +.. code-block:: shell + + circup update + +Usage Example +============= + +.. code-block:: python + + import time + import board + import displayio + import adafruit_uc8151d + + displayio.release_displays() + + # This pinout works on a Feather M4 and may need to be altered for other boards. + spi = board.SPI() # Uses SCK and MOSI + epd_cs = board.D9 + epd_dc = board.D10 + epd_reset = board.D5 + epd_busy = None + + display_bus = displayio.FourWire( + spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000 + ) + time.sleep(1) + + display = adafruit_uc8151d.UC8151D( + display_bus, width=296, height=128, rotation=90, busy_pin=epd_busy + ) + + g = displayio.Group() + + with open("/display-ruler.bmp", "rb") as f: + pic = displayio.OnDiskBitmap(f) + t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) + g.append(t) + + display.show(g) + + display.refresh() + + time.sleep(120) + + +Documentation +============= + +API documentation for this library can be found on `Read the Docs `_. + +For information on building library documentation, please check out `this guide `_. + +Contributing +============ + +Contributions are welcome! Please read our `Code of Conduct +`_ +before contributing to help this project stay welcoming. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/README.rst.license b/frozen/Adafruit_CircuitPython_UC8151D/README.rst.license new file mode 100644 index 0000000000..87eb036957 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/README.rst.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries +SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_UC8151D/adafruit_uc8151d.py b/frozen/Adafruit_CircuitPython_UC8151D/adafruit_uc8151d.py new file mode 100644 index 0000000000..1055d3d562 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/adafruit_uc8151d.py @@ -0,0 +1,132 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: MIT +""" +`adafruit_uc8151d` +================================================================================ + +CircuitPython `displayio` driver for US8151D-based ePaper displays + + +* Author(s): Melissa LeBlanc-Williams + +Implementation Notes +-------------------- + +**Hardware:** + +* `Adafruit Flexible 2.9" Black and White `_ + +**Software and Dependencies:** + +* Adafruit CircuitPython firmware for the supported boards: + https://github.com/adafruit/circuitpython/releases + +""" + +import displayio + +__version__ = "0.0.0+auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_UC8151D.git" + +_START_SEQUENCE = ( + # b"\x01\x05\x03\x00\x2b\x2b\x09" # power setting + # b"\x06\x03\x17\x17\x17" # booster soft start + b"\x04\x80\xc8" # power on and wait 10 ms + b"\x00\x01\x1f" # panel setting. Further filled in below. + b"\x50\x01\x97" # CDI setting +) + +_GRAYSCALE_START_SEQUENCE = ( + b"\x04\x80\xc8" # Power on + b"\x00\x01\xbf" # Panel setting + b"\x50\x01\x97" # CDI setting + # Common voltage + b"\x20\x2a" + b"\x00\x0A\x00\x00\x00\x01" + b"\x60\x14\x14\x00\x00\x01" + b"\x00\x14\x00\x00\x00\x01" + b"\x00\x13\x0A\x01\x00\x01" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + # White to White + b"\x21\x2a" + b"\x40\x0A\x00\x00\x00\x01" + b"\x90\x14\x14\x00\x00\x01" + b"\x10\x14\x0A\x00\x00\x01" + b"\xA0\x13\x01\x00\x00\x01" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + # Black to White + b"\x22\x2a" + b"\x40\x0A\x00\x00\x00\x01" + b"\x90\x14\x14\x00\x00\x01" + b"\x00\x14\x0A\x00\x00\x01" + b"\x99\x0B\x04\x04\x01\x01" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + # White to Black + b"\x23\x2a" + b"\x40\x0A\x00\x00\x00\x01" + b"\x90\x14\x14\x00\x00\x01" + b"\x00\x14\x0A\x00\x00\x01" + b"\x99\x0C\x01\x03\x04\x01" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + # Black to Black + b"\x24\x2a" + b"\x80\x0A\x00\x00\x00\x01" + b"\x90\x14\x14\x00\x00\x01" + b"\x20\x14\x0A\x00\x00\x01" + b"\x50\x13\x01\x00\x00\x01" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" + b"\x00\x00\x00\x00\x00\x00" +) + + +_STOP_SEQUENCE = b"\x50\x01\xf7" b"\x07\x01\xA5" # CDI setting # Deep Sleep +# pylint: disable=too-few-public-methods +class UC8151D(displayio.EPaperDisplay): + r"""UC8151D driver + + :param bus: The data bus the display is on + :param \**kwargs: + See below + + :Keyword Arguments: + * *width* (``int``) -- + Display width + * *height* (``int``) -- + Display height + * *rotation* (``int``) -- + Display rotation + """ + + def __init__(self, bus: displayio.FourWire, **kwargs) -> None: + if kwargs.get("grayscale", False): + start_sequence = bytearray(_GRAYSCALE_START_SEQUENCE) + else: + start_sequence = bytearray(_START_SEQUENCE) + width = kwargs["width"] + height = kwargs["height"] + if "rotation" in kwargs and kwargs["rotation"] % 180 != 0: + width, height = height, width + + super().__init__( + bus, + start_sequence, + _STOP_SEQUENCE, + **kwargs, + ram_width=128, + ram_height=296, + busy_state=False, + write_black_ram_command=0x13, + write_color_ram_command=0x10, + refresh_display_command=0x12, + ) diff --git a/frozen/Adafruit_CircuitPython_UC8151D/docs/_static/favicon.ico b/frozen/Adafruit_CircuitPython_UC8151D/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5aca98376a1f7e593ebd9cf41a808512c2135635 GIT binary patch literal 4414 zcmd^BX;4#F6n=SG-XmlONeGrD5E6J{RVh+e928U#MG!$jWvO+UsvWh`x&VqGNx*en zx=qox7Dqv{kPwo%fZC$dDwVpRtz{HzTkSs8QhG0)%Y=-3@Kt!4ag|JcIo?$-F|?bXVS9UDUyev>MVZQ(H8K4#;BQW-t2CPorj8^KJrMX}QK zp+e<;4ldpXz~=)2GxNy811&)gt-}Q*yVQpsxr@VMoA##{)$1~=bZ1MmjeFw?uT(`8 z^g=09<=zW%r%buwN%iHtuKSg|+r7HkT0PYN*_u9k1;^Ss-Z!RBfJ?Un4w(awqp2b3 z%+myoFis_lTlCrGx2z$0BQdh+7?!JK#9K9@Z!VrG zNj6gK5r(b4?YDOLw|DPRoN7bdP{(>GEG41YcN~4r_SUHU2hgVtUwZG@s%edC;k7Sn zC)RvEnlq~raE2mY2ko64^m1KQL}3riixh?#J{o)IT+K-RdHae2eRX91-+g!y`8^># z-zI0ir>P%Xon)!@xp-BK2bDYUB9k613NRrY6%lVjbFcQc*pRqiK~8xtkNPLxt}e?&QsTB}^!39t_%Qb)~Ukn0O%iC;zt z<&A-y;3h++)>c1br`5VFM~5(83!HKx$L+my8sW_c#@x*|*vB1yU)_dt3vH;2hqPWx zAl^6@?ipx&U7pf`a*>Yq6C85nb+B=Fnn+(id$W#WB^uHAcZVG`qg;rWB}ubvi(Y>D z$ei>REw$#xp0SHAd^|1hq&9HJ=jKK8^zTH~nk)G?yUcmTh9vUM6Y0LMw4(gYVY$D$ zGl&WY&H<)BbJ&3sYbKjx1j^=3-0Q#f^}(aP1?8^`&FUWMp|rmtpK)bLQ1Zo?^s4jqK=Lfg*9&geMGVQ z#^-*!V`fG@;H&{M9S8%+;|h&Qrxym0Ar>WT4BCVLR8cGXF=JmEYN(sNT(9vl+S|%g z8r7nXQ(95i^`=+XHo|){$vf2$?=`F$^&wFlYXyXg$B{a>$-Fp+V}+D;9k=~Xl~?C4 zAB-;RKXdUzBJE{V&d&%R>aEfFe;vxqI$0@hwVM}gFeQR@j}a>DDxR+n+-*6|_)k%% z*mSpDV|=5I9!&VC&9tD%fcVygWZV!iIo2qFtm#!*(s|@ZT33*Ad;+<|3^+yrp*;oH zBSYLV(H1zTU?2WjrCQoQW)Z>J2a=dTriuvezBmu16`tM2fm7Q@d4^iqII-xFpwHGI zn9CL}QE*1vdj2PX{PIuqOe5dracsciH6OlAZATvE8rj6ykqdIjal2 z0S0S~PwHb-5?OQ-tU-^KTG@XNrEVSvo|HIP?H;7ZhYeZkhSqh-{reE!5di;1zk$#Y zCe7rOnlzFYJ6Z#Hm$GoidKB=2HBCwm`BbZVeZY4ukmG%1uz7p2URs6c9j-Gjj^oQV zsdDb3@k2e`C$1I5ML5U0Qs0C1GAp^?!*`=|Nm(vWz3j*j*8ucum2;r0^-6Aca=Gv) zc%}&;!+_*S2tlnnJnz0EKeRmw-Y!@9ob!XQBwiv}^u9MkaXHvM=!<3YX;+2#5Cj5pp?FEK750S3BgeSDtaE^ zXUM@xoV6yBFKfzvY20V&Lr0yC + +.. toctree:: + :caption: Related Products + +Adafruit 2.9" Flexible 296x128 Monochrome eInk / ePaper Display + +.. toctree:: + :caption: Other Links + + Download from GitHub + Download Library Bundle + CircuitPython Reference Documentation + CircuitPython Support Forum + Discord Chat + Adafruit Learning System + Adafruit Blog + Adafruit Store + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst.license b/frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst.license new file mode 100644 index 0000000000..52de478909 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries + +SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_UC8151D/docs/requirements.txt b/frozen/Adafruit_CircuitPython_UC8151D/docs/requirements.txt new file mode 100644 index 0000000000..88e67331eb --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/docs/requirements.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +sphinx>=4.0.0 diff --git a/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp b/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp new file mode 100644 index 0000000000000000000000000000000000000000..726b5e026fd30b7e5baf5c23323d159b0eb5f65d GIT binary patch literal 360122 zcmeI5J<>PHa@9vfU}y)p3NQ(_AVLn79IXQnhrqzWkgEj{fdQ^IAh~k216($MfjgY% z$@}EwoAuGByQ``{{-@)Ad$O}nW@Y`VDsR7YN29;`>woyK|MIu5>%ZVX{}KQByFdHw zw||TO{Mm2+>dXDxzsLK3{qKJJ{?E4qx4-%ifAgPyZ1%7JA_;#dE)Q`n<8kq849xm9 zbD2F6vEm7f70+r@8DW~ucsA2MQ4lBo#QIm(ELJ>ivEo_nQX1HZx8>QD_9@~x@u$>$ zRh?qRlNT$V)h?xXCnwzU>`MC-vCsM`1z%XFSn=@1if2VCfz+v*(Z7>vpCxkw&no+p zYQ>7jE>=9NUCP*_5QxW?XII*%h;6b@srK4B#fs-IRy?asWrS%qIo2tat)a&LE&O z$Ws+7vEm6xIfH=CAWv1S#EK^%vyzf0pnWA)JON&*eZ{kqk|&^jC00BEUa5V>vyzf0pnWA)JON&* zeZ{kqk|&^j^-xxS^S}QyepWn;KmUJ!%)|YExRzVmSId!q#DLmY{4!t8%KFm({O|v! z^Ml5I{Jdr;FK0DlQp$Nb0qrY(2`*t}A4|A*dQ|z!qVUmW20zD9%1c;{DqeYROF;XI zUz$r;9qU)#o$(0R%)DD(XOfBzQ0)?4+fauILnv445H z{=sc#X|6hhOl^15T*9hsRs=OWdffS$o>wkrb-rL_cmx6MD}I?)va%-Q%?ka;`jWLK`0dfUmUX9Oe>JF| zZ!^or&-A=RTXu|vhM(+7q0tE4ro&{gbL?N@Nx&wG&@{a5<);I6fn z_?`sToWXm}eQ#B3SXs0BYA?n26$<_z|LuSM{a=3nD`9_q`_-&|{~fO&fZ{%%P-3Vx3@hh^16*>$`Lcc<9iEYO_5}H!{8}Htc;KZwHH?tmScYeNS zlxtX>sqj9rU}e{RO1f<&0Cn5i?pD|uR`v;meuZD`SJua@BYpL&Uq7Po82eQU{Q6q^ zzAX8l9%lY!4Xc?mQ0_Yt(7xhVWeqF)vO;62_AC5x&pxic%KrHyp?!Mcj#t$`4_Zz% zG4(5cxuv`zfi-9Fh7&(f(i&E=U!lGDmy$Q7*rx1l^tj9et@Yt<#({|+2wB7GKw%1b zGy&}^e)*QMvfg6%KXs(aUoHEra+r%*`M5IPO+fpKU*E;7ykFr@cFd<#sX-tALzq}(^vu1@1c*Re1h;lKjAvIr>#Q**6Zd_H#{m0e5;@4;~EA$!E=3OhbBY%V-_NC~z zSR_%u;#XP9I}=!Z2Jehwv$n;otY4uj>qy>+lHtt?Mto&{yKhcyxL`4>;q@!wJqc)E z@$0gfmG!IGc49j++rFUeZc5kS5tsTEzrIr5pTOcXcz+A8%7;z>gnn?@MODV<8AP4L`?G%Ehck zm90ECC!l@BFVI!2tmk+y@~)NIl*>$jx46`=`1O_Y{sgW%gZC#>R(KUF>p6D!W`)PH zU-_4n8JGfOEu41)dY8v7~0@_zR{0mumck+Ja&B|X{Yk~l;@PolmZMgD6R>S9_ zg!dt!eZ{ZEg{-V8`9H*NkKVE{1$fM9UsmxIKf!^@3t0`Eg;L#(fc6!?A{Vlhuq% z)UV+8Hf4H#Qj?UIu$nX%rM(XU?JIsQE@$Qa3N>4U!X38tE1O8P`Kb+8Ue0RxjFj*W z1hlXCRk#nU`1h}@ersH?V^8C!He7ihR>P;JgclOfzT)BEjg@~&xxvq6w(@SQX3tmo z*AURY;yK@qm48av-?Q>hEPh7wly_q_Z>Gw;l7RLVPy24Hyg~W@I0%EE&Q#^ySWTU* zk}o5meZ`}`Eh{uG`_@vw;#c!NO8slw`L($18RVz1OnF;Y{-L!D#pXb_Wwlwk1a~H& zeZ{ZNJz3qbSpn%iS@CNv7^Zij`RL1f-lnKxdGrDpq2}6OeKS0i8jfs#u8?Pe95U1at;@s$wNpJOL?Z z5YQRqsfv|Y@dS7!_LW_H$j2%H>SO1=cj98j6B8?*m6SXI?JKe33GhnoE1s2DnZqeYJ_m1!CnWHVv`bL?poh0@_zRG_evZo`94y2Io2tat)a&LE&O z$Ws+7vEm6xIfH=CAWv1S#EK^%e)zyyADgmR9pl!DN<8DE*`=qIO8yTa5VypKO!@FM#p*D+R$xS0+NGzJ zNB$2X5VypKO!@FM#p*D+PM}kT5p9H&o=zUU`UC>LLq1`$C+8?uCjqv?4J>nSWsv_v z2wx|6>xH3JJ!swWbN zTjGiJudG?D#?l5)yFBfWe)zyyADgmR9pk1b5g0{4XOJf;R(n`| z{ma|+Uxqv}DH#GfgA66ph!xLDN)ebrKxdGrDpouzDMerg0i8jfs#x)?q!fV}1at;@ zs$#{nl2Qa_5YQRqsfrcPN=gx!K|p7arz%!FD=9@_1_7Nxo~l^!tfUly83Z1522tv@ z)m}ULjMZ085qK7X2c5yMZguHDfOzfb&)Qe2Rs?1cc+eUA>Q?GkGd975oVHlkuGfTV zDdoik9<-zE2wcePL98yMq@hJ%9)ZixAm4>}Vz--USPB>0!Jnlvw^6@jM^xcm(AU5Hmsf`2)yN%K-#5qJuL%g-R+ zg?Qy8_?NSqG%uwUfu|6-{0#D4h*wU6e>tm3^HN$7cnX2b&miB0c;zJcm$RBQFQpZM zrx3XO4DwxwS5AU|Ijc$YQd$vs3W3YdAm4>}Sr?ZN+#O@&E>2P)T|JOfNibn-NUPIJ5CGi2wJa>1y-ZHcsJ6Z?oURNZ9ZCfl2x5i zlLloT5zfd?YGRR7?UQx(!`HCt*Pyp!32g30A8u2b1QwW_%;T}ZYLpl6Mk>Jl$w;!z zM+;A~sxxZRpv)t}8QEb?EU$0><3Ij>@@M%Em%14^o7H9k5{xC#-;ilLmEu@T>ut;L zu`NN%Z-K41$?v1Mu_@^1@4u}kuR6V+y#})F4cVnn)!J~S6P}aJ3gMO(#-z)NpOjo_ zc>?AB;bUD{CaHR&{xAOGYmeF8{cgm!ug>u9Ne{A- z$^$YaPnRc2{`1YsG9az`l|z23kv30!B&Qrh`nD%bGWWYt6;z!bVn$U{b;iJ|pz7R= zih@o_QC1y@cg9q^Yz(nWze}9zx3PT0_*VUD7uXLM$DPx%JBV5#Rln!K+x}Na^=*ps zY|*G{QZ{H}2y7-Qg|wndSsJ|*@S|6iWkS+Zav%d48Is2fA^vFL{y3yxSvGxNF-!Ak zjc=PxqnxINr1J=8%i|eZf|lO`(_7CLjjE2qg-JgtOd8$$5h^c_qqtCP@IO#`zyO8I{Y-XbGNOmHQ~jPWg+o?);7t0I%^o|Nl+%^1%t>Dk=NU{{3e0mX zPc@1hu~kX(V~FG#{)i!L6f@%8T9A1*$1MX>2ZKQUY7^r-1aUKvHYQFgqm0K@J(x%p z{nc!YrVOk`#j#+QS2e1X9m`XVB1bH1sCtmC>L2LD5b3f$b8-meEc?~Toc(Z&*ca&S zG6GnObUJ2uc18-zRiiM3 zU&FtDklDJH4N)y%loLaYN~JvK3HYX(XT&0L?&2@LGCRJ7U3I$O!&8(ClHc`iR0UP1 zhrmbzdyE3JlZ+HpqpHp_A?aCg27NmXZ&o%(+`NZJd|Acn9@{fb-^$ru7Z+v?O`F;FW$ z)qr!i>u2G+LQH%ta5HLC&>7ug<2}u*n!M_afiWRzW3fo(VOeWG6n^ZSgFk&=9bTPB z2Vx6h{~x~F+*=t+GV!eS?HIeMOahNh{>~#4Vw#i$&eGFz`Y0^{lPYRrLej=slgh)g zqA%4Q=s72U$UEs1&gQ;=)nUk=8Cc&*KVC5TF)M#{VwHF8LlKW#%l6D}^p)wYN5M$1 zs*j}JWGO@GEIkM*ugyFjm6Y+ZOuOm9Vr^>92&$W*>O9%35RSC!S7#RMiLu!KSoiAP zr_*^`jrG7aMm)l>&s+mjohc*6jx7o66_XFQk)OPV^ec=tuVo?ma6U?Sl0biV#pF=p z?AYD??ul>RcG*;8;E5iXYSfg+mV~7lRalt^$;pdvR;ai7Lk1g5{i0t>yHtVg{Vi6CcTD1zGA>RzIAU0go^yT{hOFrwq`#^QcXPMj2Mtpj&MbSCz5Am3r8SgCns#O`DRMGwaH zNA;_DtMKm3*g^-|l{PXL>z+Jf94!x?2?(|H>Ql0B6G z7I$8LZ%1a71Gzx`s)Qp?hX8g?r-9&Yj7>_sN*+9(`NgqhPbH96cI;T*j?5^NyFmS_ zgdto4SKmZFmZxketS2>WsRlh3XJlf+cJA4+%Og0n9 z%AeO$zS`^YR5F$k!0OK%%QvkV6Bc8O8{A31&pCqvN6R6b30?N0Wo)|8BJ%Oob(A&|b zvA17YkBWEotM!{_{fO8|XelS}UN)J>^)fCefF+w(1Co;$->>>g3N&(s`*W6&wp8Y24Ha;%j))KUvyE6lg_Z#E)QfXwPw z*Y2oEqhn?LD~PnMl3h`gidWiE1hDj@Qk8j-JYB9yezF~H%8*w5$|1kWIQ*G(IPgvM zUNaXQ@Og7dP07YGCkBmgHyaTtKu-0mc?)`N=FKmqYI&WgvXxac$axIZOSawyy;BJ{JymKuR;6WVQOVxYI*KZt!n5Hzya^PJ^3njBukY%{M>a})^l{BewxdlMvZ-I4-xcr6P`0M3 z=Y11@*^Inz%$S$;A{)Z(Xkbu#+-yXo0NK>9W-R5?b5^@kaz1^IpHM#z_`GR)Yr+t2 zC&ONm?PybmQV90M&E2iqyU-KujVc2qcfKc zDtR6~yALVeTgr_2TJqSPsy2ou+tH>B`PHvxEaf|LrUn%s-!Z}0&%#>Dq-k36YL80J z%|=8DkXHR_(rUgVZR}Cee#h)yKMQLqlct%PQs-m-36 zp$aPr%szw2j|SqqceXLFSpnT_R^{r*GnIh;FgO+OjO03lJXNvcSxG4ZGYIGm@>Io& zXCIo&XCHklHIv&V)N@*Z}iVZ=w{0M9NUK7<>)!Vie|R(N2D*Mx}G@TH7MZO_{f<}W?N3wU2bgI4`s!mHG; zj580xlKb7W?ajlFn3T%~O5;B9QLKiqT10Ag|318cHzfo*T;4-qR3Gr>Bqqb>XvFGs*7^}Mwf^8;0xiOAvVQ38YU%N|^~yVv8z#0gU?+bo&n|zbo?Ur9 zK`d7MDr1}5j}MV@F9GWbsWYHUFc+fi>We#?p9J}@NC=muwU*_N{jr$015+`>m6{SS z<0M6mM2lP2O^r`CH0KeoQA_ zj3c`V$V7Samz3ocC z#3=FQtVT^ldEP_-+tMzZl-awE%uj;mUrSt&#!h86oKcw`A-$E4vnqr6G*K5AtpDNr^{qIA+8<-j;;R4CaZ-YG4!`uxI4lRR+_YO3khz zMu{(HHEJTt^Hu_7(?~Nl0q!_cc2BJ-KAH_#N@9;mX_;NwigLj*V^Uha7|c3dj3us(zF+RX8dwp9gb{mvczY_;{6l zIjgHCu5q75AoUr0^pj-mE2?8{kQHSrna z+TM;kobjNNxC+tsB0G6pV}>c+nX-AFD2O4Zk9SvIZg}x#*s+40j@xFPHoGLVJbqMR zxXg_dGU{=5{>?fQK!*?mlP11eX4|!?Tb}Z5 ztmh6kDzsx2r@#~jeKo}V)jN~+jHX)8nS^^|Q!i4#+6(ZB`nc=NW;{02QW*)f-bR0! zCuV59jTy`??`57lc&yHJ&{~B-9IvX(52+cZuPTQ-G1l;$yAmdhjv^*Wn)qs^eL1U@ zlbt$Ch2@EJ2mAEsy!*+cMi7JgBf* zr1@K~%F1K2vO`^J=6R}h&KOSpY6jKY=EP^a{aO{4$HYCpC*9*olE;+MX&%$NZ30gM zBZfqOv`bC$_#=!Mcw0Lb>~^c#)}&&;vLvkxGyJWphL5FwH5}<%6ZZFH|1HmCR33iB zXDO?E;7t8$@uaF%&8R{BY6jI;=G@$q5Nv7^nNnYRQpkrtR{6l0uEmrv`kE2duhwwZ zC{+T>_IY*m$2qMjRm=A8tB$4`IK;VZ9o4Ufte29AzyboTUgXWnj`M;_(h%xb2}tL0 z8LLhWdL;r22(-4k_p4Szn_XM0u;Js9-&a1a0olAG?Xqhbt7S9NKq62jP~GZq#(q@| zob9X@He=AuepMY5<@GQ1t134+Mc^<2oVaRiI*C=yY-g*s;p6uERcE+FDLtxRbIpb&_G<|ajI}pp+0dPSwOMoOQSnjzYLlJ>BCv}8I^`Y6)(OF6eGd;b)UP_s^-2Wx64-1An}WR~?$R$C zUHxj;x=1Vn>j^O3fYHpWeA(#gSMwH8nMGg-fz58PDHu{lC&{t`)UP_LpjRSr2LhYj zU{f%A7Rw4?`c;}NYTLY!cG-numW`!>S_FJcv;^`WCa}4~Hw74a>XBp$I6VCrxY@6w z*lpjOEn_MiFT;#wtkSr8tP;?2RI!|KZX(?jV00YGd8d*o;0yte?e{B};SJWw!k8@!{NKQFeE+%V3x?dSrJ9M3ODpre^ke+$^9~`Cfmg zUwJBTR(#8v&Btqlv5Zw5^sRP;X?FC)Sx0|qmmZ6a{+La6ivUTiFPnWH`=hs}cEGQG zbpYCnL*m9WJ9^^8qrbFEkHtoR%qF`?dHfNEYiv2vqbc1P17&vz7|f1gog=K|5O2|{SK!c8+cVcWKSSvqnRxFVpqQ!yKu^OhCsDndBXl% zmn}2a*MnZvX-ECHQ?Yca8auA~)mWY{$X0$oBv196CJi{a$Mx<>l+0fZX*u0*2JUvX z#&SPoE!$psF-d9pqbBC@w+jsGOV#^=(W^tKUsbVGoy%BNM}L_!o6gmVQz}bO z8C80YMV-&nAJ^V~?0wl8)c4iL?y>5`dfqOTrN>5(_fiu*{c2;L544w^ zL499+;O^>7IiApt9bX|^d^EfC*r3s0dg5C?4--{tN(iL}p6IO3w9NB?9`!4J(U-B} zOM0}@4rx56>Dbz0#)_sAw~> z(hMiC>R0^QEn~%(B&7&^6oF-DP~TS{wXZZ;5tu<> zS-+Z5{NkKqwHUaD6M;lPXD|WjJc?BZj$Vnt0s=aNJY=!rSxG4ZGYIGm@>Io&XSJ!s z|9%Ia?fdu3pW9|O2|k3t*N)M}5fCem6Q%lTMa{p)EFvFie6p>bz^}eo?P6t}s1;&w zz42NKbP28Q%A$nlD|I>`fL9EEt_YK3)<8!8L>9Li^iivk$M-Q>L$NZjT zuhAd0^>*(lFVII6m`;2&J9*;c3#QLcAx^wXrlc1`_<>%gBw3xAHHP@UsE;dOCWQE) zqij#O*XS3}db@X&cj#L*%%9%I$9GKsz$~g{kSD@{9Ul*j^4t)cyWdMPRnM{c`X~%- z)5NFf;VYc1lPTRE*-)ZdjM_lMee>l%rUL=yV>@)c-Hcg`(sPvp4^obct z4x64Rc;b`~*BmEq_NFHa4v+ijKoBqpcDK1yJ!m!d^Z9;7eqZj1#?Q-N{u%|lY-FkG zqrYWW1NS;(a>U}%F3`uwQ?hcszjBXf za1V@_E!t7T+tnfX@Wsk!Rl68Y8cwVdkj|r6b>Q@0MRd{jC^+ph4{U$+dgG%edvZ0! ziU%lGJgcMxI;ZDGRr4+Upk@UKEg*@H9>r?c9?-tpg)52;UA)J)%j|o8wP|1R8$hg{ z&g!0LFj4hw2E*;7S@3vIRu=;4Fc+&1ob*bp5|Ga0Jz1rK;fsEF-`VbjzY{`uF<8>goHcUw?mn`{!4&k*!$$ zN+UjHTdX1xouglAV0Sb>8`^Kaa&!W}-^OvWt=LFJoPVX!+>nro)rYg{v<~f!58oSc T`pMSbh(J1r2r{u6#p?e9C4JK7 literal 0 HcmV?d00001 diff --git a/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp.license b/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp.license new file mode 100644 index 0000000000..a784acfa32 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp.license @@ -0,0 +1,2 @@ +# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries +# SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_grayscale_test.py b/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_grayscale_test.py new file mode 100644 index 0000000000..71b8316a87 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_grayscale_test.py @@ -0,0 +1,68 @@ +# SPDX-FileCopyrightText: 2022 Martin Refseth, written for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +"""Simple test script for 1.54" 152x152 grayscale display. + +Supported products: + * 1.54" Grayscale Display (GDEW0154T8D) + """ +# pylint: disable=no-member + +import time +import board +import displayio +import busio +import adafruit_uc8151d + +displayio.release_displays() + +# Pinout intended for use with a Raspberry Pi Pico +clk = board.GP10 +si = board.GP11 +dc = board.GP8 +cs = board.GP9 +rst = board.GP12 +busy = board.GP13 + +display_bus = displayio.FourWire( + busio.SPI(clk, si), command=dc, chip_select=cs, reset=rst, baudrate=1000000 +) + +time.sleep(1) + +display = adafruit_uc8151d.UC8151D( + display_bus, width=152, height=152, busy_pin=busy, rotation=180, grayscale=True +) + + +bitmap = displayio.Bitmap(152, 152, 4) + +# Draw Black +for x in range(0, 152): + for y in range(0, 38): + bitmap[x, y] = 0 +# Draw Dark Gray +for x in range(0, 152): + for y in range(38, 76): + bitmap[x, y] = 1 +# Draw Light Gray +for x in range(0, 152): + for y in range(76, 114): + bitmap[x, y] = 2 +# Draw White +for x in range(0, 152): + for y in range(114, 152): + bitmap[x, y] = 3 + +palette = displayio.Palette(4) +palette[0] = 0x000000 # Black +palette[1] = 0x404040 # Dark Gray +palette[2] = 0x808080 # Light Gray +palette[3] = 0xFFFFFF # White + +g = displayio.Group() +t = displayio.TileGrid(bitmap, pixel_shader=palette) +g.append(t) +display.show(g) +display.refresh() diff --git a/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_simpletest.py b/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_simpletest.py new file mode 100644 index 0000000000..a6a068fc2d --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_simpletest.py @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +"""Simple test script for 2.9" 296x128 monochrome display. + +Supported products: + * Adafruit Flexible 2.9" Monochrome + * https://www.adafruit.com/product/4262 + """ +# pylint: disable=no-member + +import time +import board +import displayio +import adafruit_uc8151d + +displayio.release_displays() + +# This pinout works on a Feather M4 and may need to be altered for other boards. +spi = board.SPI() # Uses SCK and MOSI +epd_cs = board.D9 +epd_dc = board.D10 +epd_reset = board.D5 +epd_busy = None + +display_bus = displayio.FourWire( + spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000 +) +time.sleep(1) + +display = adafruit_uc8151d.UC8151D( + display_bus, width=296, height=128, rotation=90, busy_pin=epd_busy +) + +g = displayio.Group() + +with open("/display-ruler.bmp", "rb") as f: + pic = displayio.OnDiskBitmap(f) + t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) + g.append(t) + + display.show(g) + + display.refresh() + + time.sleep(120) diff --git a/frozen/Adafruit_CircuitPython_UC8151D/optional_requirements.txt b/frozen/Adafruit_CircuitPython_UC8151D/optional_requirements.txt new file mode 100644 index 0000000000..d4e27c4d74 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/optional_requirements.txt @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense diff --git a/frozen/Adafruit_CircuitPython_UC8151D/pyproject.toml b/frozen/Adafruit_CircuitPython_UC8151D/pyproject.toml new file mode 100644 index 0000000000..4c3129c59f --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/pyproject.toml @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +[build-system] +requires = [ + "setuptools", + "wheel", + "setuptools-scm", +] + +[project] +name = "adafruit-circuitpython-uc8151d" +description = "CircuitPython `displayio` driver for US8151D-based ePaper displays" +version = "0.0.0+auto.0" +readme = "README.rst" +authors = [ + {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} +] +urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_UC8151D.git"} +keywords = [ + "adafruit", + "blinka", + "circuitpython", + "micropython", + "uc8151d", + "uc8151", + "us8151d", + "displayio", + "epd", + "epaper", + "flexible", +] +license = {text = "MIT"} +classifiers = [ + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Embedded Systems", + "Topic :: System :: Hardware", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", +] +dynamic = ["dependencies", "optional-dependencies"] + +[tool.setuptools] +py-modules = ["adafruit_uc8151d"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} +optional-dependencies = {optional = {file = ["optional_requirements.txt"]}} diff --git a/frozen/Adafruit_CircuitPython_UC8151D/requirements.txt b/frozen/Adafruit_CircuitPython_UC8151D/requirements.txt new file mode 100644 index 0000000000..274b851a2d --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D/requirements.txt @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +Adafruit-Blinka +adafruit-blinka-displayio diff --git a/ports/espressif/boards/maker_badge/board.c b/ports/espressif/boards/maker_badge/board.c new file mode 100644 index 0000000000..7f2b45c2c5 --- /dev/null +++ b/ports/espressif/boards/maker_badge/board.c @@ -0,0 +1,63 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "mpconfigboard.h" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-module/displayio/__init__.h" +#include "supervisor/shared/board.h" + +#include "components/log/include/esp_log.h" + +#define DELAY 0x80 + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ + +} + +//busio_spi_obj_t *spi = common_hal_board_create_spi(); + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/maker_badge/mpconfigboard.h b/ports/espressif/boards/maker_badge/mpconfigboard.h new file mode 100644 index 0000000000..3c4a993364 --- /dev/null +++ b/ports/espressif/boards/maker_badge/mpconfigboard.h @@ -0,0 +1,55 @@ +/* + * 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 "Maker badge by Czech maker" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define MICROPY_HW_NEOPIXEL_COUNT (4) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_GPIO18 1 +#define IGNORE_PIN_GPIO19 1 + +#define DOUBLE_TAP_PIN (&pin_GPIO38) diff --git a/ports/espressif/boards/maker_badge/mpconfigboard.mk b/ports/espressif/boards/maker_badge/mpconfigboard.mk new file mode 100644 index 0000000000..6faba2aed3 --- /dev/null +++ b/ports/espressif/boards/maker_badge/mpconfigboard.mk @@ -0,0 +1,29 @@ +USB_VID = 0x239A +USB_PID = 0x2030 +USB_PRODUCT = "Maker badge" +USB_MANUFACTURER = "Czech maker" + +IDF_TARGET = esp32s2 + +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_ESP32_CAMERA = 0 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wroom + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Display_Text +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_UC8151D +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SSD1680 diff --git a/ports/espressif/boards/maker_badge/pins.c b/ports/espressif/boards/maker_badge/pins.c new file mode 100644 index 0000000000..f573b20be8 --- /dev/null +++ b/ports/espressif/boards/maker_badge/pins.c @@ -0,0 +1,87 @@ +#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_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_CAP5), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_CAP4), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_CAP3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_CAP2), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_CAP1), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER_INVERTED), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + + { 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_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { 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_D42), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From d774f3d34f0c18028516f253c3c401c0c933e380 Mon Sep 17 00:00:00 2001 From: dronecz Date: Thu, 27 Oct 2022 15:02:44 +0200 Subject: [PATCH 007/357] Update board.c Fix for CLI --- ports/espressif/boards/maker_badge/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/maker_badge/board.c b/ports/espressif/boards/maker_badge/board.c index 7f2b45c2c5..4b244087f6 100644 --- a/ports/espressif/boards/maker_badge/board.c +++ b/ports/espressif/boards/maker_badge/board.c @@ -49,7 +49,7 @@ void board_init(void) { } -//busio_spi_obj_t *spi = common_hal_board_create_spi(); +// busio_spi_obj_t *spi = common_hal_board_create_spi(); bool board_requests_safe_mode(void) { return false; From 9307b62ad54bcd27c493e8d63dc91059e6612b79 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 27 Oct 2022 22:42:04 -0400 Subject: [PATCH 008/357] wip --- main.c | 42 +++++++++---------- ports/atmel-samd/common-hal/alarm/__init__.c | 17 +++++--- .../common-hal/alarm/pin/PinAlarm.c | 3 +- .../common-hal/alarm/pin/PinAlarm.h | 2 +- .../common-hal/alarm/time/TimeAlarm.c | 9 ++-- .../common-hal/alarm/time/TimeAlarm.h | 2 +- ports/atmel-samd/supervisor/port.c | 4 ++ ports/espressif/common-hal/alarm/__init__.c | 19 ++++++--- .../common-hal/alarm/coproc/CoprocAlarm.c | 6 +-- .../common-hal/alarm/coproc/CoprocAlarm.h | 2 +- .../espressif/common-hal/alarm/pin/PinAlarm.c | 3 +- .../espressif/common-hal/alarm/pin/PinAlarm.h | 2 +- .../common-hal/alarm/time/TimeAlarm.c | 9 ++-- .../common-hal/alarm/time/TimeAlarm.h | 2 +- .../common-hal/alarm/touch/TouchAlarm.c | 3 +- .../common-hal/alarm/touch/TouchAlarm.h | 2 +- ports/espressif/supervisor/port.c | 8 ++++ ports/nrf/common-hal/alarm/__init__.c | 16 +++++-- ports/nrf/common-hal/alarm/pin/PinAlarm.c | 3 +- ports/nrf/common-hal/alarm/pin/PinAlarm.h | 2 +- ports/nrf/common-hal/alarm/time/TimeAlarm.c | 9 ++-- ports/nrf/common-hal/alarm/time/TimeAlarm.h | 2 +- ports/nrf/common-hal/alarm/touch/TouchAlarm.c | 2 +- ports/nrf/common-hal/alarm/touch/TouchAlarm.h | 2 +- ports/nrf/supervisor/port.c | 8 ++++ ports/raspberrypi/common-hal/alarm/__init__.c | 13 ++++-- .../common-hal/alarm/pin/PinAlarm.c | 4 +- .../common-hal/alarm/pin/PinAlarm.h | 2 +- .../common-hal/alarm/time/TimeAlarm.c | 9 ++-- .../common-hal/alarm/time/TimeAlarm.h | 2 +- ports/raspberrypi/supervisor/port.c | 8 ++++ ports/stm/common-hal/alarm/__init__.c | 13 ++++-- ports/stm/common-hal/alarm/pin/PinAlarm.c | 3 +- ports/stm/common-hal/alarm/pin/PinAlarm.h | 2 +- ports/stm/common-hal/alarm/time/TimeAlarm.c | 9 ++-- ports/stm/common-hal/alarm/time/TimeAlarm.h | 2 +- ports/stm/supervisor/port.c | 12 ++++-- shared-bindings/alarm/__init__.h | 2 +- 38 files changed, 159 insertions(+), 101 deletions(-) diff --git a/main.c b/main.c index 06ca1ba93b..fea20d419b 100644 --- a/main.c +++ b/main.c @@ -132,7 +132,7 @@ static void reset_devices(void) { #endif } -STATIC void start_mp(supervisor_allocation *heap, bool first_run) { +STATIC void start_mp(supervisor_allocation *heap) { supervisor_workflow_reset(); // Stack limit should be less than real stack size, so we have a chance @@ -176,14 +176,6 @@ STATIC void start_mp(supervisor_allocation *heap, bool first_run) { mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_lib)); mp_obj_list_init((mp_obj_list_t *)mp_sys_argv, 0); - - #if CIRCUITPY_ALARM - // Record which alarm woke us up, if any. An object may be created so the heap must be functional. - // There is no alarm if this is not the first time code.py or the REPL has been run. - shared_alarm_save_wake_alarm(first_run ? common_hal_alarm_create_wake_alarm() : mp_const_none); - // Reset alarm module only after we retrieved the wakeup alarm. - alarm_reset(); - #endif } STATIC void stop_mp(void) { @@ -373,7 +365,7 @@ STATIC void print_code_py_status_message(safe_mode_t safe_mode) { } } -STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_reset) { +STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { bool serial_connected_at_start = serial_connected(); bool printed_safe_mode_message = false; #if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 @@ -409,8 +401,8 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re supervisor_allocation *heap = allocate_remaining_memory(); - // Prepare the VM state. Includes an alarm check/reset for sleep. - start_mp(heap, first_run); + // Prepare the VM state. + start_mp(heap); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -853,12 +845,12 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { #endif } -STATIC int run_repl(bool first_run) { +STATIC int run_repl(void) { int exit_code = PYEXEC_FORCED_EXIT; stack_resize(); filesystem_flush(); supervisor_allocation *heap = allocate_remaining_memory(); - start_mp(heap, first_run); + start_mp(heap); #if CIRCUITPY_USB usb_setup_with_vm(); @@ -968,6 +960,12 @@ int __attribute__((used)) main(void) { safe_mode = NO_CIRCUITPY; } + #if CIRCUITPY_ALARM + // Record which alarm woke us up, if any. + // common_hal_alarm_record_wake_alarm() should return a static, non-heap object + shared_alarm_save_wake_alarm(common_hal_alarm_record_wake_alarm()); + #endif + // Reset everything and prep MicroPython to run boot.py. reset_port(); // Port-independent devices, like CIRCUITPY_BLEIO_HCI. @@ -1001,20 +999,18 @@ int __attribute__((used)) main(void) { // Boot script is finished, so now go into REPL or run code.py. int exit_code = PYEXEC_FORCED_EXIT; bool skip_repl = true; - bool first_run = true; - bool simulate_reset; + bool simulate_reset = true; for (;;) { - simulate_reset = false; if (!skip_repl) { - exit_code = run_repl(first_run); + exit_code = run_repl(); supervisor_set_run_reason(RUN_REASON_REPL_RELOAD); } if (exit_code == PYEXEC_FORCED_EXIT) { - if (!first_run) { + if (!simulate_reset) { serial_write_compressed(translate("soft reboot\n")); } if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) { - skip_repl = run_code_py(safe_mode, first_run, &simulate_reset); + skip_repl = run_code_py(safe_mode, &simulate_reset); } else { skip_repl = false; } @@ -1025,7 +1021,11 @@ int __attribute__((used)) main(void) { // Either the REPL or code.py has run and finished. // If code.py did a fake deep sleep, pretend that we are running code.py for // the first time after a hard reset. This will preserve any alarm information. - first_run = simulate_reset; + if (!simulate_reset) { + #if CIRCUITPY_ALARM + shared_alarm_save_wake_alarm(mp_const_none); + #endif + } } mp_deinit(); return 0; diff --git a/ports/atmel-samd/common-hal/alarm/__init__.c b/ports/atmel-samd/common-hal/alarm/__init__.c index 8f66b3a90c..2edd3ece12 100644 --- a/ports/atmel-samd/common-hal/alarm/__init__.c +++ b/ports/atmel-samd/common-hal/alarm/__init__.c @@ -48,6 +48,13 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; +// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// This object lives across VM instantiations, so none of these objects can contain references to the heap. +static union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; +} wake_alarm; + void alarm_reset(void) { // Reset the alarm flag alarm_pin_pinalarm_reset(); @@ -57,7 +64,7 @@ void alarm_reset(void) { void alarm_get_wakeup_cause(void) { // Called from rtc_init, just before SWRST of RTC. It is called // at an early stage of main(), to save TAMPID from SWRST. Later, - // common_hal_alarm_create_wake_alarm is called to make a wakeup + // common_hal_alarm_record_wake_alarm is called to make a wakeup // alarm from the deep sleep. TAMPID = RTC->MODE0.TAMPID.reg; @@ -67,7 +74,7 @@ bool common_hal_alarm_woken_from_sleep(void) { return alarm_pin_pinalarm_woke_this_cycle() || alarm_time_timealarm_woke_this_cycle(); } -mp_obj_t common_hal_alarm_create_wake_alarm(void) { +mp_obj_t common_hal_alarm_record_wake_alarm(void) { // Called from main.c on the first start up, just before alarm_reset. // Return a copy of wakeup alarm from deep sleep / fake deep sleep. // In case of fake sleep, status should be left in TimeAlarm/PinAlarm. @@ -76,13 +83,13 @@ mp_obj_t common_hal_alarm_create_wake_alarm(void) { if (alarm_pin_pinalarm_woke_this_cycle()) { TAMPID = RTC->MODE0.TAMPID.reg; RTC->MODE0.TAMPID.reg = TAMPID; // clear register - return alarm_pin_pinalarm_create_wakeup_alarm(TAMPID); + return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm, TAMPID); } if (alarm_time_timealarm_woke_this_cycle() || (true_deep && TAMPID == 0)) { - return alarm_time_timealarm_create_wakeup_alarm(); + return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); } if (true_deep) { - return alarm_pin_pinalarm_create_wakeup_alarm(TAMPID); + return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm, TAMPID); } return mp_const_none; } diff --git a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c index 9289a66a87..a2c01f0a82 100644 --- a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c @@ -128,12 +128,11 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(uint32_t TAMPID) { +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm, uint32_t TAMPID) { // Create tamper alarm that caused wakeup from deep sleep for (samd_tamper_pin_t *t = TAMPER_PINS; t->n >= 0; t++) { if (TAMPID & (1 << t->n)) { - alarm_pin_pinalarm_obj_t *alarm = m_new_obj(alarm_pin_pinalarm_obj_t); alarm->base.type = &alarm_pin_pinalarm_type; alarm->pin = t->pin; return alarm; diff --git a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.h b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.h index 57dc7d6c65..6f767bbffc 100644 --- a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.h +++ b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.h @@ -39,7 +39,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(uint32_t TAMPID); +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm, uint32_t TAMPID); void pin_alarm_callback(uint8_t num); void alarm_pin_pinalarm_reset(void); diff --git a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c index 3f116f07e3..9c7c89f2c7 100644 --- a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c @@ -58,13 +58,12 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void) { - alarm_time_timealarm_obj_t *timer = m_new_obj(alarm_time_timealarm_obj_t); - timer->base.type = &alarm_time_timealarm_type; +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. // Or don't, most of the other ports don't have this either. - timer->monotonic_time = 0.0f; - return timer; + alarm->monotonic_time = 0.0f; + return alarm; } void time_alarm_callback(void) { diff --git a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.h b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.h index a6102dee6b..b8af80869c 100644 --- a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.h +++ b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.h @@ -35,7 +35,7 @@ typedef struct { } alarm_time_timealarm_obj_t; mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void); +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); void time_alarm_callback(void); bool alarm_time_timealarm_woke_this_cycle(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 424acece78..0fafbdb13c 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -385,6 +385,10 @@ safe_mode_t port_init(void) { } void reset_port(void) { + #if CIRCUITPY_ALARM + alarm_reset(); + #endif + #if CIRCUITPY_BUSIO reset_sercoms(); #endif diff --git a/ports/espressif/common-hal/alarm/__init__.c b/ports/espressif/common-hal/alarm/__init__.c index 4183b7e61b..7faca8fc0c 100644 --- a/ports/espressif/common-hal/alarm/__init__.c +++ b/ports/espressif/common-hal/alarm/__init__.c @@ -58,6 +58,15 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; +// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// This object lives across VM instantiations, so none of these objects can contain references to the heap. +static union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; + alarm_touch_touchalarm_obj_t touch_alarm; + alarm_coproc_coprocalarm_obj_t coproc_alarm; +} wake_alarm; + void alarm_reset(void) { alarm_sleep_memory_reset(); alarm_pin_pinalarm_reset(); @@ -90,27 +99,27 @@ bool common_hal_alarm_woken_from_sleep(void) { return _get_wakeup_cause() != ESP_SLEEP_WAKEUP_UNDEFINED; } -mp_obj_t common_hal_alarm_create_wake_alarm(void) { +mp_obj_t common_hal_alarm_record_wake_alarm(void) { // If woken from deep sleep, create a copy alarm similar to what would have // been passed in originally. Otherwise, just return none esp_sleep_wakeup_cause_t cause = _get_wakeup_cause(); switch (cause) { case ESP_SLEEP_WAKEUP_TIMER: { - return alarm_time_timealarm_create_wakeup_alarm(); + return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); } case ESP_SLEEP_WAKEUP_GPIO: case ESP_SLEEP_WAKEUP_EXT0: case ESP_SLEEP_WAKEUP_EXT1: { - return alarm_pin_pinalarm_create_wakeup_alarm(); + return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm); } case ESP_SLEEP_WAKEUP_TOUCHPAD: { - return alarm_touch_touchalarm_create_wakeup_alarm(); + return alarm_touch_touchalarm_record_wakeup_alarm(&wake_alarm.touch_alarm); } case ESP_SLEEP_WAKEUP_ULP: { - return alarm_coproc_coprocalarm_create_wakeup_alarm(); + return alarm_coproc_coprocalarm_record_wakeup_alarm(&wake_alarm.coproc_alarm); } case ESP_SLEEP_WAKEUP_UNDEFINED: diff --git a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c index aa49e13a2a..8c45cc208c 100644 --- a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c +++ b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c @@ -47,9 +47,7 @@ mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, co return mp_const_none; } -mp_obj_t alarm_coproc_coprocalarm_create_wakeup_alarm(void) { - // Create CoprocAlarm object. - alarm_coproc_coprocalarm_obj_t *alarm = m_new_obj(alarm_coproc_coprocalarm_obj_t); +mp_obj_t alarm_coproc_coprocalarm_record_wakeup_alarm(alarm_coproc_coprocalarm_obj_t *alarm) { alarm->base.type = &alarm_coproc_coprocalarm_type; return alarm; } @@ -111,7 +109,7 @@ mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, co return mp_const_none; } -mp_obj_t alarm_coproc_coprocalarm_create_wakeup_alarm(void) { +mp_obj_t alarm_coproc_coprocalarm_record_wakeup_alarm(void) { return mp_const_none; } diff --git a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h index d70e90265d..2078d8325f 100644 --- a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h +++ b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h @@ -38,7 +38,7 @@ typedef struct { } alarm_coproc_coprocalarm_obj_t; mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_coproc_coprocalarm_create_wakeup_alarm(void); +mp_obj_t alarm_coproc_coprocalarm_record_wakeup_alarm(void); void alarm_coproc_coprocalarm_prepare_for_deep_sleep(void); void alarm_coproc_coprocalarm_reset(void); diff --git a/ports/espressif/common-hal/alarm/pin/PinAlarm.c b/ports/espressif/common-hal/alarm/pin/PinAlarm.c index bc89cc9ee7..3868e2f4a8 100644 --- a/ports/espressif/common-hal/alarm/pin/PinAlarm.c +++ b/ports/espressif/common-hal/alarm/pin/PinAlarm.c @@ -111,7 +111,7 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void) { +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) { esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); // Pin status will persist into a fake deep sleep @@ -135,7 +135,6 @@ mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void) { } } - alarm_pin_pinalarm_obj_t *alarm = m_new_obj(alarm_pin_pinalarm_obj_t); alarm->base.type = &alarm_pin_pinalarm_type; alarm->pin = NULL; // Map the pin number back to a pin object. diff --git a/ports/espressif/common-hal/alarm/pin/PinAlarm.h b/ports/espressif/common-hal/alarm/pin/PinAlarm.h index cbc20b996c..d1d5d1e4f0 100644 --- a/ports/espressif/common-hal/alarm/pin/PinAlarm.h +++ b/ports/espressif/common-hal/alarm/pin/PinAlarm.h @@ -35,7 +35,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void); +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(void); void alarm_pin_pinalarm_prepare_for_deep_sleep(void); void alarm_pin_pinalarm_reset(void); diff --git a/ports/espressif/common-hal/alarm/time/TimeAlarm.c b/ports/espressif/common-hal/alarm/time/TimeAlarm.c index 973da33c67..f0daabc897 100644 --- a/ports/espressif/common-hal/alarm/time/TimeAlarm.c +++ b/ports/espressif/common-hal/alarm/time/TimeAlarm.c @@ -51,12 +51,11 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void) { - alarm_time_timealarm_obj_t *timer = m_new_obj(alarm_time_timealarm_obj_t); - timer->base.type = &alarm_time_timealarm_type; +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. - timer->monotonic_time = 0.0f; - return timer; + alarm->monotonic_time = 0.0f; + return alarm; } esp_timer_handle_t pretend_sleep_timer; diff --git a/ports/espressif/common-hal/alarm/time/TimeAlarm.h b/ports/espressif/common-hal/alarm/time/TimeAlarm.h index 36986e06b2..edb4d0236f 100644 --- a/ports/espressif/common-hal/alarm/time/TimeAlarm.h +++ b/ports/espressif/common-hal/alarm/time/TimeAlarm.h @@ -33,7 +33,7 @@ typedef struct { } alarm_time_timealarm_obj_t; mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void); +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); void alarm_time_timealarm_reset(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c index ad55e1e056..35da811ad9 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c @@ -52,9 +52,8 @@ mp_obj_t alarm_touch_touchalarm_find_triggered_alarm(const size_t n_alarms, cons return mp_const_none; } -mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) { +mp_obj_t alarm_touch_touchalarm_record_wakeup_alarm(alarm_touch_touchalarm_obj_t *alarm) { // Create TouchAlarm object. - alarm_touch_touchalarm_obj_t *alarm = m_new_obj(alarm_touch_touchalarm_obj_t); alarm->base.type = &alarm_touch_touchalarm_type; alarm->pin = NULL; diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.h b/ports/espressif/common-hal/alarm/touch/TouchAlarm.h index df2521c12a..c5cb8da3e9 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.h +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.h @@ -36,7 +36,7 @@ typedef struct { } alarm_touch_touchalarm_obj_t; mp_obj_t alarm_touch_touchalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void); +mp_obj_t alarm_touch_touchalarm_record_wakeup_alarm(alarm_touch_touchalarm_obj_t *alarm); void alarm_touch_touchalarm_prepare_for_deep_sleep(void); void alarm_touch_touchalarm_reset(void); diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 3106f4b991..54e2026c7d 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -60,6 +60,10 @@ #include "peripherals/rmt.h" #include "peripherals/timer.h" +#if CIRCUITPY_ALARM +#include "common-hal/alarm/__init__.h" +#endif + #if CIRCUITPY_COUNTIO || CIRCUITPY_ROTARYIO || CIRCUITPY_FREQUENCYIO #include "peripherals/pcnt.h" #endif @@ -338,6 +342,10 @@ safe_mode_t port_init(void) { } void reset_port(void) { + #if CIRCUITPY_ALARM + alarm_reset(); + #endif + // TODO deinit for esp32-camera #if CIRCUITPY_ESP32_CAMERA esp_camera_deinit(); diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 75f616c805..8501092c9d 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -56,6 +56,14 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; +// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// This object lives across VM instantiations, so none of these objects can contain references to the heap. +static union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; + alarm_touch_touchalarm_obj_t touch_alarm; +} wake_alarm; + void alarm_reset(void) { alarm_sleep_memory_reset(); alarm_pin_pinalarm_reset(); @@ -115,19 +123,19 @@ bool common_hal_alarm_woken_from_sleep(void) { || cause == NRF_SLEEP_WAKEUP_TOUCHPAD; } -mp_obj_t common_hal_alarm_create_wake_alarm(void) { +mp_obj_t common_hal_alarm_record_wake_alarm(void) { // If woken from deep sleep, create a copy alarm similar to what would have // been passed in originally. Otherwise, just return none nrf_sleep_source_t cause = _get_wakeup_cause(); switch (cause) { case NRF_SLEEP_WAKEUP_TIMER: { - return alarm_time_timealarm_create_wakeup_alarm(); + return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); } case NRF_SLEEP_WAKEUP_TOUCHPAD: { - return alarm_touch_touchalarm_create_wakeup_alarm(); + return alarm_touch_touchalarm_record_wakeup_alarm(&wake_alarm.touch_alarm); } case NRF_SLEEP_WAKEUP_GPIO: { - return alarm_pin_pinalarm_create_wakeup_alarm(); + return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm); } default: break; diff --git a/ports/nrf/common-hal/alarm/pin/PinAlarm.c b/ports/nrf/common-hal/alarm/pin/PinAlarm.c index 9d0f8f4b88..b48f0b46a7 100644 --- a/ports/nrf/common-hal/alarm/pin/PinAlarm.c +++ b/ports/nrf/common-hal/alarm/pin/PinAlarm.c @@ -101,8 +101,7 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void) { - alarm_pin_pinalarm_obj_t *alarm = m_new_obj(alarm_pin_pinalarm_obj_t); +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) { alarm->base.type = &alarm_pin_pinalarm_type; alarm->pin = NULL; // Map the pin number back to a pin object. diff --git a/ports/nrf/common-hal/alarm/pin/PinAlarm.h b/ports/nrf/common-hal/alarm/pin/PinAlarm.h index 87b7b9833c..3a16a50d8a 100644 --- a/ports/nrf/common-hal/alarm/pin/PinAlarm.h +++ b/ports/nrf/common-hal/alarm/pin/PinAlarm.h @@ -35,7 +35,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void); +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm); void alarm_pin_pinalarm_reset(void); void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/nrf/common-hal/alarm/time/TimeAlarm.c b/ports/nrf/common-hal/alarm/time/TimeAlarm.c index 03b91068f9..af1ce694ee 100644 --- a/ports/nrf/common-hal/alarm/time/TimeAlarm.c +++ b/ports/nrf/common-hal/alarm/time/TimeAlarm.c @@ -49,12 +49,11 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void) { - alarm_time_timealarm_obj_t *timer = m_new_obj(alarm_time_timealarm_obj_t); - timer->base.type = &alarm_time_timealarm_type; +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. - timer->monotonic_time = 0.0f; - return timer; + alarm->monotonic_time = 0.0f; + return alarm; } bool alarm_time_timealarm_woke_this_cycle(void) { diff --git a/ports/nrf/common-hal/alarm/time/TimeAlarm.h b/ports/nrf/common-hal/alarm/time/TimeAlarm.h index 734feb1c87..2af5121e10 100644 --- a/ports/nrf/common-hal/alarm/time/TimeAlarm.h +++ b/ports/nrf/common-hal/alarm/time/TimeAlarm.h @@ -37,7 +37,7 @@ extern void port_disable_interrupt_after_ticks_ch(uint32_t channel); extern void port_interrupt_after_ticks_ch(uint32_t channel, uint32_t ticks); mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void); +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); bool alarm_time_timealarm_woke_this_cycle(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/nrf/common-hal/alarm/touch/TouchAlarm.c b/ports/nrf/common-hal/alarm/touch/TouchAlarm.c index f8daf50f54..9bd2fefcce 100644 --- a/ports/nrf/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/nrf/common-hal/alarm/touch/TouchAlarm.c @@ -39,7 +39,7 @@ mp_obj_t alarm_touch_touchalarm_find_triggered_alarm(const size_t n_alarms, cons return mp_const_none; } -mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) { +mp_obj_t alarm_touch_touchalarm_record_wakeup_alarm(alarm_touch_touchalarm_obj_t *alarm) { return mp_const_none; } diff --git a/ports/nrf/common-hal/alarm/touch/TouchAlarm.h b/ports/nrf/common-hal/alarm/touch/TouchAlarm.h index 58ad8c20fe..d895414cd3 100644 --- a/ports/nrf/common-hal/alarm/touch/TouchAlarm.h +++ b/ports/nrf/common-hal/alarm/touch/TouchAlarm.h @@ -37,7 +37,7 @@ typedef struct { // Find the alarm object that caused us to wake up or create an equivalent one. mp_obj_t alarm_touch_touchalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void); +mp_obj_t alarm_touch_touchalarm_record_wakeup_alarm(void); // Check for the wake up alarm from pretend deep sleep. void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms); void alarm_touch_touchalarm_prepare_for_deep_sleep(void); diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 0ed1ecd547..477829c2d2 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -64,6 +64,10 @@ #include "lib/tinyusb/src/device/usbd.h" +#if CIRCUITPY_ALARM +#include "common-hal/alarm/__init__.h" +#endif + #ifdef CIRCUITPY_AUDIOBUSIO #include "common-hal/audiobusio/I2SOut.h" #endif @@ -212,6 +216,10 @@ safe_mode_t port_init(void) { } void reset_port(void) { + #if CIRCUITPY_ALARM + alarm_reset(); + #endif + #if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); diff --git a/ports/raspberrypi/common-hal/alarm/__init__.c b/ports/raspberrypi/common-hal/alarm/__init__.c index 9cfa390116..c184ab95d9 100644 --- a/ports/raspberrypi/common-hal/alarm/__init__.c +++ b/ports/raspberrypi/common-hal/alarm/__init__.c @@ -96,6 +96,13 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; +// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// This object lives across VM instantiations, so none of these objects can contain references to the heap. +static union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; +} wake_alarm; + void alarm_reset(void) { alarm_sleep_memory_reset(); alarm_pin_pinalarm_reset(); @@ -131,17 +138,17 @@ bool common_hal_alarm_woken_from_sleep(void) { return _get_wakeup_cause() != RP_SLEEP_WAKEUP_UNDEF; } -mp_obj_t common_hal_alarm_create_wake_alarm(void) { +mp_obj_t common_hal_alarm_record_wake_alarm(void) { // If woken from deep sleep, create a copy alarm similar to what would have // been passed in originally. Otherwise, just return none uint8_t cause = _get_wakeup_cause(); switch (cause) { case RP_SLEEP_WAKEUP_RTC: { - return alarm_time_timealarm_create_wakeup_alarm(); + return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); } case RP_SLEEP_WAKEUP_GPIO: { - return alarm_pin_pinalarm_create_wakeup_alarm(); + return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm); } case RP_SLEEP_WAKEUP_UNDEF: diff --git a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c index 28ea60d682..388cba3d8a 100644 --- a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c +++ b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c @@ -94,10 +94,10 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void) { - alarm_pin_pinalarm_obj_t *alarm = m_new_obj(alarm_pin_pinalarm_obj_t); +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) { alarm->base.type = &alarm_pin_pinalarm_type; // TODO: how to obtain the correct pin from memory? + alarm->pin = NULL; return alarm; } diff --git a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h index d31ac6c878..1e576b9382 100644 --- a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h +++ b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h @@ -36,7 +36,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void); +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm); void alarm_pin_pinalarm_reset(void); void alarm_pin_pinalarm_light_reset(void); diff --git a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c index 16ac8fc31e..81eb78bcb1 100644 --- a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c +++ b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c @@ -58,12 +58,11 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void) { - alarm_time_timealarm_obj_t *timer = m_new_obj(alarm_time_timealarm_obj_t); - timer->base.type = &alarm_time_timealarm_type; +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. - timer->monotonic_time = 0.0f; - return timer; + alarm->monotonic_time = 0.0f; + return alarm; } bool alarm_time_timealarm_woke_this_cycle(void) { diff --git a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.h b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.h index d5248551ae..4d5569a569 100644 --- a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.h +++ b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.h @@ -33,7 +33,7 @@ typedef struct { } alarm_time_timealarm_obj_t; mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void); +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); void alarm_time_timealarm_reset(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 781d2b11d2..d1eff62d56 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -41,6 +41,10 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/pwmio/PWMOut.h" +#if CIRCUITPY_ALARM +#include "common-hal/alarm/__init__.h" +#endif + #if CIRCUITPY_SSL #include "common-hal/ssl/__init__.h" #endif @@ -154,6 +158,10 @@ safe_mode_t port_init(void) { } void reset_port(void) { + #if CIRCUITPY_ALARM + alarm_reset(); + #endif + #if CIRCUITPY_BUSIO reset_i2c(); reset_spi(); diff --git a/ports/stm/common-hal/alarm/__init__.c b/ports/stm/common-hal/alarm/__init__.c index 26099b0503..4763403842 100644 --- a/ports/stm/common-hal/alarm/__init__.c +++ b/ports/stm/common-hal/alarm/__init__.c @@ -47,6 +47,13 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; +// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// This object lives across VM instantiations, so none of these objects can contain references to the heap. +static union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; +} wake_alarm; + STATIC stm_sleep_source_t true_deep_wake_reason; void alarm_reset(void) { @@ -81,16 +88,16 @@ bool common_hal_alarm_woken_from_sleep(void) { return alarm_get_wakeup_cause() != STM_WAKEUP_UNDEF; } -mp_obj_t common_hal_alarm_create_wake_alarm(void) { +mp_obj_t common_hal_alarm_record_wake_alarm(void) { // If woken from deep sleep, create a copy alarm similar to what would have // been passed in originally. Otherwise, just return none stm_sleep_source_t cause = alarm_get_wakeup_cause(); switch (cause) { case STM_WAKEUP_RTC: { - return alarm_time_timealarm_create_wakeup_alarm(); + return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); } case STM_WAKEUP_GPIO: { - return alarm_pin_pinalarm_create_wakeup_alarm(); + return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm); } case STM_WAKEUP_UNDEF: default: diff --git a/ports/stm/common-hal/alarm/pin/PinAlarm.c b/ports/stm/common-hal/alarm/pin/PinAlarm.c index 0e5fa9e94d..50bd06b59a 100644 --- a/ports/stm/common-hal/alarm/pin/PinAlarm.c +++ b/ports/stm/common-hal/alarm/pin/PinAlarm.c @@ -100,8 +100,7 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void) { - alarm_pin_pinalarm_obj_t *alarm = m_new_obj(alarm_pin_pinalarm_obj_t); +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) { alarm->base.type = &alarm_pin_pinalarm_type; // TODO: replace this if/when other WKUP pins are supported alarm->pin = &pin_PA00; diff --git a/ports/stm/common-hal/alarm/pin/PinAlarm.h b/ports/stm/common-hal/alarm/pin/PinAlarm.h index bc52849a53..1490944fdf 100644 --- a/ports/stm/common-hal/alarm/pin/PinAlarm.h +++ b/ports/stm/common-hal/alarm/pin/PinAlarm.h @@ -38,7 +38,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_create_wakeup_alarm(void); +mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm); void alarm_pin_pinalarm_reset(void); void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/stm/common-hal/alarm/time/TimeAlarm.c b/ports/stm/common-hal/alarm/time/TimeAlarm.c index 6d508cd8cc..a1ebd3fa05 100644 --- a/ports/stm/common-hal/alarm/time/TimeAlarm.c +++ b/ports/stm/common-hal/alarm/time/TimeAlarm.c @@ -53,12 +53,11 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void) { - alarm_time_timealarm_obj_t *timer = m_new_obj(alarm_time_timealarm_obj_t); - timer->base.type = &alarm_time_timealarm_type; +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. - timer->monotonic_time = 0.0f; - return timer; + alarm->monotonic_time = 0.0f; + return alarm; } // This is run in the timer task. We use it to wake the main CircuitPython task. diff --git a/ports/stm/common-hal/alarm/time/TimeAlarm.h b/ports/stm/common-hal/alarm/time/TimeAlarm.h index 48531ebdf6..05e77a90be 100644 --- a/ports/stm/common-hal/alarm/time/TimeAlarm.h +++ b/ports/stm/common-hal/alarm/time/TimeAlarm.h @@ -35,7 +35,7 @@ typedef struct { } alarm_time_timealarm_obj_t; mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_create_wakeup_alarm(void); +mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); bool alarm_time_timealarm_woke_this_cycle(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 97bd1c4982..adfce78cba 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -33,7 +33,10 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" -#ifdef CIRCUITPY_AUDIOPWMIO +#if CIRCUITPY_ALARM +#include "common-hal/alarm/__init__.h" +#endif +#if CIRCUITPY_AUDIOPWMIO #include "common-hal/audiopwmio/PWMAudioOut.h" #endif #if CIRCUITPY_BUSIO @@ -57,9 +60,6 @@ #if CIRCUITPY_PULSEIO || CIRCUITPY_ALARM #include "peripherals/exti.h" #endif -#if CIRCUITPY_ALARM -#include "common-hal/alarm/__init__.h" -#endif #if CIRCUITPY_RTC #include "shared-bindings/rtc/__init__.h" #endif @@ -244,6 +244,10 @@ void SysTick_Handler(void) { void reset_port(void) { reset_all_pins(); + #if CIRCUITPY_ALARM + alarm_reset(); + #endif + #if CIRCUITPY_RTC rtc_reset(); #endif diff --git a/shared-bindings/alarm/__init__.h b/shared-bindings/alarm/__init__.h index ea86e44f2f..82bfae4286 100644 --- a/shared-bindings/alarm/__init__.h +++ b/shared-bindings/alarm/__init__.h @@ -55,7 +55,7 @@ extern void common_hal_alarm_pretending_deep_sleep(void); extern mp_obj_t shared_alarm_get_wake_alarm(void); // Creates a new alarm object after exiting deep sleep (real or fake) -extern mp_obj_t common_hal_alarm_create_wake_alarm(void); +extern mp_obj_t common_hal_alarm_record_wake_alarm(void); // Saves alarm to global array void shared_alarm_save_wake_alarm(mp_obj_t alarm); From b94447fde5fe3f0ee21fc68a7216fd4af67d3614 Mon Sep 17 00:00:00 2001 From: CDario Date: Fri, 28 Oct 2022 05:00:54 +0000 Subject: [PATCH 009/357] Added safe mode button --- locale/circuitpython.pot | 6 +++++- ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index dda2cbd02c..dc80d88d87 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2642,7 +2642,7 @@ msgstr "" msgid "can't set 512 block size" msgstr "" -#: py/objnamedtuple.c +#: py/objexcept.c py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -3844,6 +3844,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "pressing the left button at start up\n" msgstr "" diff --git a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h index 616a156cb2..131ba0bf26 100644 --- a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +++ b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h @@ -38,6 +38,12 @@ #define CIRCUITPY_BOARD_SPI (1) #define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO39) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing central button at start up.\n") + // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) #define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) From b276ed7af9a441d315d931c13a04f4df1fc99bea Mon Sep 17 00:00:00 2001 From: CDario Date: Fri, 28 Oct 2022 05:32:09 +0000 Subject: [PATCH 010/357] Fixed copyright attribution --- ports/espressif/boards/m5stack_atom_lite/board.c | 2 +- ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/m5stack_atom_lite/board.c b/ports/espressif/boards/m5stack_atom_lite/board.c index 66fa51c9fd..e9b7e9bfb3 100644 --- a/ports/espressif/boards/m5stack_atom_lite/board.c +++ b/ports/espressif/boards/m5stack_atom_lite/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2022 Dario Cammi * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h index 131ba0bf26..5d136fa264 100644 --- a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +++ b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2022 Dan Halbert for Adafruit Industries + * Copyright (c) 2022 Dario Cammi * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From 27142d090b2a72d0e2fd170e32bab17bdcb16717 Mon Sep 17 00:00:00 2001 From: CDario Date: Fri, 28 Oct 2022 11:08:30 +0000 Subject: [PATCH 011/357] Fixed copyright attribution --- ports/espressif/boards/m5stack_atom_lite/board.c | 2 +- ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/m5stack_atom_lite/board.c b/ports/espressif/boards/m5stack_atom_lite/board.c index e9b7e9bfb3..3e64883633 100644 --- a/ports/espressif/boards/m5stack_atom_lite/board.c +++ b/ports/espressif/boards/m5stack_atom_lite/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2022 Dario Cammi + * Copyright (c) 2022 CDarius * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h index 5d136fa264..fdc79ec744 100644 --- a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +++ b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2022 Dario Cammi + * Copyright (c) 2022 CDarius * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From 7282bd9c9a7caa41aff0a7114345bf7b812b9bbb Mon Sep 17 00:00:00 2001 From: CDarius Date: Sat, 29 Oct 2022 09:34:45 +0200 Subject: [PATCH 012/357] Removed boilerplate already handled by MP_WEAK definitions Co-authored-by: Dan Halbert --- ports/espressif/boards/m5stack_atom_lite/board.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ports/espressif/boards/m5stack_atom_lite/board.c b/ports/espressif/boards/m5stack_atom_lite/board.c index 3e64883633..c0d9676d86 100644 --- a/ports/espressif/boards/m5stack_atom_lite/board.c +++ b/ports/espressif/boards/m5stack_atom_lite/board.c @@ -25,14 +25,5 @@ */ #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) { -} - -void reset_board(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. From 2ffd16a10c80fea73a3e95b02dc50e4df11af22b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 29 Oct 2022 09:27:09 -0400 Subject: [PATCH 013/357] Update mpconfigboard.mk --- ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk index 70b348b4f1..b58d3aa24e 100644 --- a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk +++ b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk @@ -6,3 +6,5 @@ IDF_TARGET = esp32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_USB_CAMERA = 0 From a064b52ad767dc0300bed8fad0606d907f06183e Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 29 Oct 2022 10:13:11 -0400 Subject: [PATCH 015/357] CIRCUITPY_ESP32_CAMERA, not CIRCUITPY_USB_CAMERA --- ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk index b58d3aa24e..6adf65d2bc 100644 --- a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk +++ b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.mk @@ -7,4 +7,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_USB_CAMERA = 0 +CIRCUITPY_ESP32_CAMERA = 0 From 2893ab355721a8eb6406cc4b56207611830990b6 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 28 Oct 2022 21:27:07 +0000 Subject: [PATCH 016/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1004 of 1004 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b1a17276a3..56555528a8 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-10-22 18:28+0000\n" +"PO-Revision-Date: 2022-10-29 18:16+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -3952,7 +3952,7 @@ msgstr "pressionando ambos os botões durante a inicialização.\n" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" -msgstr "" +msgstr "pressionando o botão A na inicialização.\n" #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "pressing the left button at start up\n" From 16eb601caae8af2f336b1e9fb9f3bb1922916794 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sat, 29 Oct 2022 00:19:22 +0000 Subject: [PATCH 017/357] Translated using Weblate (Swedish) Currently translated at 100.0% (1004 of 1004 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 23be78bc7e..03d49a36ec 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-10-22 18:28+0000\n" +"PO-Revision-Date: 2022-10-29 18:16+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -3900,7 +3900,7 @@ msgstr "genom att trycka på VOLUME-knappen vid start.\n" #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h #: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" -msgstr "trycka på startknappen vid start.\n" +msgstr "genom att trycka på startknappen vid start.\n" #: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -3908,16 +3908,16 @@ msgstr "trycka på startknappen vid start.\n" #: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "pressing both buttons at start up.\n" -msgstr "trycka båda knapparna vid uppstart.\n" +msgstr "genom att trycka båda knapparna vid uppstart.\n" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" -msgstr "" +msgstr "genom att tryck på knappen A vid start.\n" #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "pressing the left button at start up\n" -msgstr "håll ner vänster knapp vid start\n" +msgstr "genom att håll ner vänster knapp vid start\n" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" From ec7df0d17c1926ab6f3afbbb92a9bbed47329b47 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 29 Oct 2022 20:16:41 +0200 Subject: [PATCH 018/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 4 ++++ locale/cs.po | 4 ++++ locale/de_DE.po | 4 ++++ locale/el.po | 4 ++++ locale/en_GB.po | 4 ++++ locale/es.po | 4 ++++ locale/fil.po | 4 ++++ locale/fr.po | 4 ++++ locale/hi.po | 4 ++++ locale/it_IT.po | 4 ++++ locale/ja.po | 4 ++++ locale/ko.po | 4 ++++ locale/nl.po | 4 ++++ locale/pl.po | 4 ++++ locale/pt_BR.po | 4 ++++ locale/ru.po | 4 ++++ locale/sv.po | 4 ++++ locale/tr.po | 4 ++++ locale/zh_Latn_pinyin.po | 4 ++++ 19 files changed, 76 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 62189a8309..5947e6698d 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -3876,6 +3876,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/cs.po b/locale/cs.po index d331cd0932..d1db5450f2 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3862,6 +3862,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/de_DE.po b/locale/de_DE.po index 7ce418f552..b5f9d29836 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -3943,6 +3943,10 @@ msgstr "Drücken der Boot-Taste beim Start.\n" msgid "pressing both buttons at start up.\n" msgstr "Drücken Sie beim Start beide Tasten.\n" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/el.po b/locale/el.po index 5f9c88153f..202fcaf4c5 100644 --- a/locale/el.po +++ b/locale/el.po @@ -3871,6 +3871,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/en_GB.po b/locale/en_GB.po index 93053214c8..6be6e327f5 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -3881,6 +3881,10 @@ msgstr "pressing boot button at start up.\n" msgid "pressing both buttons at start up.\n" msgstr "pressing both buttons at start up.\n" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/es.po b/locale/es.po index c7b12ff86b..0251226112 100644 --- a/locale/es.po +++ b/locale/es.po @@ -3928,6 +3928,10 @@ msgstr "presionando botón de arranque al inicio.\n" msgid "pressing both buttons at start up.\n" msgstr "presionando ambos botones al inicio.\n" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/fil.po b/locale/fil.po index f11b7018da..390ced89ac 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -3881,6 +3881,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/fr.po b/locale/fr.po index 885562a32d..302afa03ae 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -3970,6 +3970,10 @@ msgstr "bouton boot appuyé lors du démarrage.\n" msgid "pressing both buttons at start up.\n" msgstr "les deux boutons appuyés lors du démarrage.\n" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/hi.po b/locale/hi.po index bdeb76c08c..78f93241b7 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -3844,6 +3844,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index 98018a7f5c..bdfd83f211 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -3894,6 +3894,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/ja.po b/locale/ja.po index 506de879a4..1b66c38ea9 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -3865,6 +3865,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/ko.po b/locale/ko.po index fe5b81c864..9bca1c348b 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -3848,6 +3848,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/nl.po b/locale/nl.po index 1f3cc3ff18..9c39c1a68a 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -3881,6 +3881,10 @@ msgstr "druk bootknop in bij opstarten.\n" msgid "pressing both buttons at start up.\n" msgstr "druk beide knoppen in bij opstarten.\n" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/pl.po b/locale/pl.po index 57d54dce23..dd91cd66fd 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -3857,6 +3857,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 56555528a8..94f13567da 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3949,6 +3949,10 @@ msgstr "pressionando o botão de boot na inicialização.\n" msgid "pressing both buttons at start up.\n" msgstr "pressionando ambos os botões durante a inicialização.\n" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/ru.po b/locale/ru.po index e82169f771..8a3dcef040 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -3893,6 +3893,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/sv.po b/locale/sv.po index 03d49a36ec..28cf8f6693 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -3910,6 +3910,10 @@ msgstr "genom att trycka på startknappen vid start.\n" msgid "pressing both buttons at start up.\n" msgstr "genom att trycka båda knapparna vid uppstart.\n" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/tr.po b/locale/tr.po index 47779ff1f9..ee72e1b336 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -3864,6 +3864,10 @@ msgstr "" msgid "pressing both buttons at start up.\n" msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9c02f40da4..b713d93d40 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -3909,6 +3909,10 @@ msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" msgid "pressing both buttons at start up.\n" msgstr "zài qǐdòng shí tóngshí àn xià liǎng gè ànniǔ.\n" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "pressing central button at start up.\n" +msgstr "" + #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "pressing button A at start up.\n" From ded134c346cd6c0f3c2823311163bb900b04bef5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 29 Oct 2022 16:26:36 -0400 Subject: [PATCH 019/357] store wake_alarm in a static object --- main.c | 21 ++++++++++--------- .../atmel-samd/common-hal/alarm/SleepMemory.h | 5 +---- ports/atmel-samd/common-hal/alarm/__init__.c | 13 +++++------- ports/atmel-samd/common-hal/alarm/__init__.h | 18 ++++++++++------ .../common-hal/alarm/pin/PinAlarm.c | 6 +++--- .../common-hal/alarm/pin/PinAlarm.h | 9 ++++---- .../common-hal/alarm/time/TimeAlarm.c | 6 ++++-- .../common-hal/alarm/time/TimeAlarm.h | 7 ++----- .../common-hal/alarm/touch/TouchAlarm.h | 5 +---- ports/atmel-samd/supervisor/port.c | 4 ---- .../espressif/common-hal/alarm/SleepMemory.h | 5 +---- ports/espressif/common-hal/alarm/__init__.c | 17 ++++++--------- ports/espressif/common-hal/alarm/__init__.h | 19 ++++++++++++----- .../common-hal/alarm/coproc/CoprocAlarm.c | 7 +++++-- .../common-hal/alarm/coproc/CoprocAlarm.h | 7 ++----- .../espressif/common-hal/alarm/pin/PinAlarm.c | 8 ++++--- .../espressif/common-hal/alarm/pin/PinAlarm.h | 6 +++++- .../common-hal/alarm/time/TimeAlarm.c | 5 ++++- .../common-hal/alarm/time/TimeAlarm.h | 3 ++- .../common-hal/alarm/touch/TouchAlarm.c | 6 ++++-- .../common-hal/alarm/touch/TouchAlarm.h | 7 ++----- ports/espressif/supervisor/port.c | 8 ------- ports/nrf/common-hal/alarm/SleepMemory.h | 5 +---- ports/nrf/common-hal/alarm/__init__.c | 14 +++++-------- ports/nrf/common-hal/alarm/__init__.h | 15 +++++++++---- ports/nrf/common-hal/alarm/pin/PinAlarm.c | 7 ++++--- ports/nrf/common-hal/alarm/pin/PinAlarm.h | 6 +++++- ports/nrf/common-hal/alarm/time/TimeAlarm.c | 6 ++++-- ports/nrf/common-hal/alarm/time/TimeAlarm.h | 3 ++- ports/nrf/common-hal/alarm/touch/TouchAlarm.c | 3 ++- ports/nrf/common-hal/alarm/touch/TouchAlarm.h | 7 ++----- ports/nrf/supervisor/port.c | 12 ++--------- .../common-hal/alarm/SleepMemory.h | 5 +---- ports/raspberrypi/common-hal/alarm/__init__.c | 11 ++++------ ports/raspberrypi/common-hal/alarm/__init__.h | 13 ++++++++---- .../common-hal/alarm/pin/PinAlarm.c | 6 ++++-- .../common-hal/alarm/pin/PinAlarm.h | 6 +++++- .../common-hal/alarm/time/TimeAlarm.c | 5 ++++- .../common-hal/alarm/time/TimeAlarm.h | 3 ++- .../common-hal/alarm/touch/TouchAlarm.h | 5 +---- ports/raspberrypi/supervisor/port.c | 8 ------- ports/stm/common-hal/alarm/SleepMemory.h | 5 +---- ports/stm/common-hal/alarm/__init__.c | 11 ++++------ ports/stm/common-hal/alarm/__init__.h | 16 +++++++++----- ports/stm/common-hal/alarm/pin/PinAlarm.c | 5 ++++- ports/stm/common-hal/alarm/pin/PinAlarm.h | 9 ++++---- ports/stm/common-hal/alarm/time/TimeAlarm.c | 5 ++++- ports/stm/common-hal/alarm/time/TimeAlarm.h | 7 ++----- ports/stm/common-hal/alarm/touch/TouchAlarm.h | 5 +---- ports/stm/supervisor/port.c | 12 ++++------- 50 files changed, 196 insertions(+), 211 deletions(-) diff --git a/main.c b/main.c index fea20d419b..10fdc65224 100644 --- a/main.c +++ b/main.c @@ -747,8 +747,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { supervisor_allocation *heap = allocate_remaining_memory(); - // true means this is the first set of VM's after a hard reset. - start_mp(heap, true); + start_mp(heap); #if CIRCUITPY_USB // Set up default USB values after boot.py VM starts but before running boot.py. @@ -964,6 +963,9 @@ int __attribute__((used)) main(void) { // Record which alarm woke us up, if any. // common_hal_alarm_record_wake_alarm() should return a static, non-heap object shared_alarm_save_wake_alarm(common_hal_alarm_record_wake_alarm()); + // Then reset the alarm system. It's not reset in reset_port(), because that's also called + // on VM teardown, which would clear any alarm setup. + alarm_reset(); #endif // Reset everything and prep MicroPython to run boot.py. @@ -1010,6 +1012,9 @@ int __attribute__((used)) main(void) { serial_write_compressed(translate("soft reboot\n")); } if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) { + // If code.py did a fake deep sleep, pretend that we + // are running code.py for the first time after a hard + // reset. This will preserve any alarm information. skip_repl = run_code_py(safe_mode, &simulate_reset); } else { skip_repl = false; @@ -1018,14 +1023,10 @@ int __attribute__((used)) main(void) { break; } - // Either the REPL or code.py has run and finished. - // If code.py did a fake deep sleep, pretend that we are running code.py for - // the first time after a hard reset. This will preserve any alarm information. - if (!simulate_reset) { - #if CIRCUITPY_ALARM - shared_alarm_save_wake_alarm(mp_const_none); - #endif - } + #if CIRCUITPY_ALARM + shared_alarm_save_wake_alarm(simulate_reset ? common_hal_alarm_record_wake_alarm() : mp_const_none); + alarm_reset(); + #endif } mp_deinit(); return 0; diff --git a/ports/atmel-samd/common-hal/alarm/SleepMemory.h b/ports/atmel-samd/common-hal/alarm/SleepMemory.h index 5fad5946e2..14848cd5a0 100644 --- a/ports/atmel-samd/common-hal/alarm/SleepMemory.h +++ b/ports/atmel-samd/common-hal/alarm/SleepMemory.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_SLEEPMEMORY_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_SLEEPMEMORY_H +#pragma once #include "py/obj.h" @@ -34,5 +33,3 @@ typedef struct { } alarm_sleep_memory_obj_t; extern void alarm_sleep_memory_reset(void); - -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_SLEEPMEMORY_H diff --git a/ports/atmel-samd/common-hal/alarm/__init__.c b/ports/atmel-samd/common-hal/alarm/__init__.c index 2edd3ece12..96d6d9694a 100644 --- a/ports/atmel-samd/common-hal/alarm/__init__.c +++ b/ports/atmel-samd/common-hal/alarm/__init__.c @@ -48,12 +48,9 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; -// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// Non-heap alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. // This object lives across VM instantiations, so none of these objects can contain references to the heap. -static union { - alarm_pin_pinalarm_obj_t pin_alarm; - alarm_time_timealarm_obj_t time_alarm; -} wake_alarm; +alarm_wake_alarm_union_t alarm_wake_alarm; void alarm_reset(void) { // Reset the alarm flag @@ -83,13 +80,13 @@ mp_obj_t common_hal_alarm_record_wake_alarm(void) { if (alarm_pin_pinalarm_woke_this_cycle()) { TAMPID = RTC->MODE0.TAMPID.reg; RTC->MODE0.TAMPID.reg = TAMPID; // clear register - return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm, TAMPID); + return alarm_pin_pinalarm_record_wake_alarm(TAMPID); } if (alarm_time_timealarm_woke_this_cycle() || (true_deep && TAMPID == 0)) { - return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); + return alarm_time_timealarm_record_wake_alarm(); } if (true_deep) { - return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm, TAMPID); + return alarm_pin_pinalarm_record_wake_alarm(TAMPID); } return mp_const_none; } diff --git a/ports/atmel-samd/common-hal/alarm/__init__.h b/ports/atmel-samd/common-hal/alarm/__init__.h index 061775e568..3094811c27 100644 --- a/ports/atmel-samd/common-hal/alarm/__init__.h +++ b/ports/atmel-samd/common-hal/alarm/__init__.h @@ -24,10 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM__INIT__H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM__INIT__H +#pragma once #include "common-hal/alarm/SleepMemory.h" +#include "common-hal/alarm/pin/PinAlarm.h" +#include "common-hal/alarm/time/TimeAlarm.h" extern const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; @@ -53,8 +54,13 @@ typedef enum { SAMD_WAKEUP_RTC } samd_sleep_source_t; -extern void alarm_set_wakeup_reason(samd_sleep_source_t reason); -void alarm_get_wakeup_cause(void); -extern void alarm_reset(void); +typedef union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; +} alarm_wake_alarm_union_t; -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM__INIT__H +extern alarm_wake_alarm_union_t alarm_wake_alarm; + +extern void alarm_set_wakeup_reason(samd_sleep_source_t reason); +extern void alarm_get_wakeup_cause(void); +extern void alarm_reset(void); diff --git a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c index a2c01f0a82..dd2509b8c4 100644 --- a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c @@ -31,9 +31,9 @@ #include "hal/include/hal_gpio.h" // #include +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/pin/PinAlarm.h" #include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/microcontroller/Pin.h" #include "common-hal/alarm/__init__.h" // This variable stores whether a PinAlarm woke in light sleep or fake deep sleep @@ -128,8 +128,8 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm, uint32_t TAMPID) { - // Create tamper alarm that caused wakeup from deep sleep +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(uint32_t TAMPID) { + alarm_pin_pinalarm_obj_t *const alarm = &alarm_wake_alarm.pin_alarm; for (samd_tamper_pin_t *t = TAMPER_PINS; t->n >= 0; t++) { if (TAMPID & (1 << t->n)) { diff --git a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.h b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.h index 6f767bbffc..ee9ea07b71 100644 --- a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.h +++ b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.h @@ -24,12 +24,13 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_PINALARM_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_PINALARM_H +#pragma once #include "py/obj.h" #include "py/objtuple.h" +#include "shared-bindings/microcontroller/Pin.h" + typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; @@ -39,7 +40,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm, uint32_t TAMPID); +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(uint32_t TAMPID); void pin_alarm_callback(uint8_t num); void alarm_pin_pinalarm_reset(void); @@ -47,5 +48,3 @@ void alarm_pin_pinalarm_deinit_alarms(size_t n_alarms, const mp_obj_t *alarms); void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); void alarm_pin_pinalarm_prepare_for_deep_sleep(void); bool alarm_pin_pinalarm_woke_this_cycle(void); - -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_PINALARM_H diff --git a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c index 9c7c89f2c7..2ead87428b 100644 --- a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c @@ -27,9 +27,9 @@ #include "py/runtime.h" #include "hpl/pm/hpl_pm_base.h" +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/time/TimeAlarm.h" #include "shared-bindings/time/__init__.h" -#include "common-hal/alarm/__init__.h" #include "supervisor/port.h" STATIC volatile bool woke_up = false; @@ -58,7 +58,9 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { +mp_obj_t alarm_time_timealarm_record_wake_alarm(void) { + alarm_time_timealarm_obj_t *const alarm = &alarm_wake_alarm.time_alarm; + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. // Or don't, most of the other ports don't have this either. diff --git a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.h b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.h index b8af80869c..ee517e0236 100644 --- a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.h +++ b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_TIMEALARM_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_TIMEALARM_H +#pragma once #include "py/obj.h" @@ -35,12 +34,10 @@ typedef struct { } alarm_time_timealarm_obj_t; mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); +mp_obj_t alarm_time_timealarm_record_wake_alarm(void); void time_alarm_callback(void); bool alarm_time_timealarm_woke_this_cycle(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); void alarm_time_timealarm_reset(void); void alarm_time_timealarm_prepare_for_deep_sleep(void); - -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_TIMEALARM_H diff --git a/ports/atmel-samd/common-hal/alarm/touch/TouchAlarm.h b/ports/atmel-samd/common-hal/alarm/touch/TouchAlarm.h index d7f0f8cf1d..59f202c69d 100644 --- a/ports/atmel-samd/common-hal/alarm/touch/TouchAlarm.h +++ b/ports/atmel-samd/common-hal/alarm/touch/TouchAlarm.h @@ -24,12 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_TOUCHALARM_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_TOUCHALARM_H +#pragma once typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; } alarm_touch_touchalarm_obj_t; - -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_ALARM_TOUCHALARM_H diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 0fafbdb13c..424acece78 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -385,10 +385,6 @@ safe_mode_t port_init(void) { } void reset_port(void) { - #if CIRCUITPY_ALARM - alarm_reset(); - #endif - #if CIRCUITPY_BUSIO reset_sercoms(); #endif diff --git a/ports/espressif/common-hal/alarm/SleepMemory.h b/ports/espressif/common-hal/alarm/SleepMemory.h index 37d6cd371f..626f748a67 100644 --- a/ports/espressif/common-hal/alarm/SleepMemory.h +++ b/ports/espressif/common-hal/alarm/SleepMemory.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM_SLEEPMEMORY_H -#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM_SLEEPMEMORY_H +#pragma once #include "py/obj.h" @@ -49,5 +48,3 @@ typedef struct { } alarm_sleep_memory_obj_t; extern void alarm_sleep_memory_reset(void); - -#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM_SLEEPMEMORY_H diff --git a/ports/espressif/common-hal/alarm/__init__.c b/ports/espressif/common-hal/alarm/__init__.c index 7faca8fc0c..02ce3e1082 100644 --- a/ports/espressif/common-hal/alarm/__init__.c +++ b/ports/espressif/common-hal/alarm/__init__.c @@ -58,14 +58,9 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; -// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// Non-heap alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. // This object lives across VM instantiations, so none of these objects can contain references to the heap. -static union { - alarm_pin_pinalarm_obj_t pin_alarm; - alarm_time_timealarm_obj_t time_alarm; - alarm_touch_touchalarm_obj_t touch_alarm; - alarm_coproc_coprocalarm_obj_t coproc_alarm; -} wake_alarm; +alarm_wake_alarm_union_t alarm_wake_alarm; void alarm_reset(void) { alarm_sleep_memory_reset(); @@ -105,21 +100,21 @@ mp_obj_t common_hal_alarm_record_wake_alarm(void) { esp_sleep_wakeup_cause_t cause = _get_wakeup_cause(); switch (cause) { case ESP_SLEEP_WAKEUP_TIMER: { - return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); + return alarm_time_timealarm_record_wake_alarm(); } case ESP_SLEEP_WAKEUP_GPIO: case ESP_SLEEP_WAKEUP_EXT0: case ESP_SLEEP_WAKEUP_EXT1: { - return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm); + return alarm_pin_pinalarm_record_wake_alarm(); } case ESP_SLEEP_WAKEUP_TOUCHPAD: { - return alarm_touch_touchalarm_record_wakeup_alarm(&wake_alarm.touch_alarm); + return alarm_touch_touchalarm_record_wake_alarm(); } case ESP_SLEEP_WAKEUP_ULP: { - return alarm_coproc_coprocalarm_record_wakeup_alarm(&wake_alarm.coproc_alarm); + return alarm_coproc_coprocalarm_record_wake_alarm(); } case ESP_SLEEP_WAKEUP_UNDEFINED: diff --git a/ports/espressif/common-hal/alarm/__init__.h b/ports/espressif/common-hal/alarm/__init__.h index ae7286db76..9f762f9c00 100644 --- a/ports/espressif/common-hal/alarm/__init__.h +++ b/ports/espressif/common-hal/alarm/__init__.h @@ -24,13 +24,22 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM__INIT__H -#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM__INIT__H +#pragma once #include "common-hal/alarm/SleepMemory.h" +#include "common-hal/alarm/coproc/CoprocAlarm.h" +#include "common-hal/alarm/pin/PinAlarm.h" +#include "common-hal/alarm/time/TimeAlarm.h" +#include "common-hal/alarm/touch/TouchAlarm.h" -const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; +typedef union { + alarm_coproc_coprocalarm_obj_t coproc_alarm; + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; + alarm_touch_touchalarm_obj_t touch_alarm; +} alarm_wake_alarm_union_t; + +extern alarm_wake_alarm_union_t alarm_wake_alarm; +extern const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; extern void alarm_reset(void); - -#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ALARM__INIT__H diff --git a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c index 8c45cc208c..9ee187d27c 100644 --- a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c +++ b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/coproc/CoprocAlarm.h" #include "shared-bindings/coproc/__init__.h" @@ -47,7 +48,9 @@ mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, co return mp_const_none; } -mp_obj_t alarm_coproc_coprocalarm_record_wakeup_alarm(alarm_coproc_coprocalarm_obj_t *alarm) { +mp_obj_t alarm_coproc_coprocalarm_record_wake_alarm(void) { + alarm_coproc_coprocalarm_obj_t *const alarm = &alarm_wake_alarm.coproc_alarm; + alarm->base.type = &alarm_coproc_coprocalarm_type; return alarm; } @@ -109,7 +112,7 @@ mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, co return mp_const_none; } -mp_obj_t alarm_coproc_coprocalarm_record_wakeup_alarm(void) { +mp_obj_t alarm_coproc_coprocalarm_record_wake_alarm(void) { return mp_const_none; } diff --git a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h index 2078d8325f..57a9bcdbff 100644 --- a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h +++ b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_COMMON_HAL_ALARM_COPROC_COPROCALARM_H -#define MICROPY_INCLUDED_COMMON_HAL_ALARM_COPROC_COPROCALARM_H +#pragma once #include "py/obj.h" #include "py/runtime.h" @@ -38,11 +37,9 @@ typedef struct { } alarm_coproc_coprocalarm_obj_t; mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_coproc_coprocalarm_record_wakeup_alarm(void); +mp_obj_t alarm_coproc_coprocalarm_record_wake_alarm(void); void alarm_coproc_coprocalarm_prepare_for_deep_sleep(void); void alarm_coproc_coprocalarm_reset(void); void alarm_coproc_coprocalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms); bool alarm_coproc_coprocalarm_woke_this_cycle(void); - -#endif // MICROPY_INCLUDED_COMMON_HAL_ALARM_COPROC_COPROCALARM_H diff --git a/ports/espressif/common-hal/alarm/pin/PinAlarm.c b/ports/espressif/common-hal/alarm/pin/PinAlarm.c index 3868e2f4a8..6db184a4dd 100644 --- a/ports/espressif/common-hal/alarm/pin/PinAlarm.c +++ b/ports/espressif/common-hal/alarm/pin/PinAlarm.c @@ -26,10 +26,10 @@ */ #include "py/runtime.h" - #include "supervisor/port.h" + +#include "common-hal/alarm/__init__.h" #include "shared-bindings/alarm/pin/PinAlarm.h" -#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "esp_sleep.h" @@ -111,7 +111,7 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) { +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(void) { esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); // Pin status will persist into a fake deep sleep @@ -135,6 +135,8 @@ mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) } } + alarm_pin_pinalarm_obj_t *const alarm = &alarm_wake_alarm.pin_alarm; + alarm->base.type = &alarm_pin_pinalarm_type; alarm->pin = NULL; // Map the pin number back to a pin object. diff --git a/ports/espressif/common-hal/alarm/pin/PinAlarm.h b/ports/espressif/common-hal/alarm/pin/PinAlarm.h index d1d5d1e4f0..309b27c2e9 100644 --- a/ports/espressif/common-hal/alarm/pin/PinAlarm.h +++ b/ports/espressif/common-hal/alarm/pin/PinAlarm.h @@ -24,9 +24,13 @@ * THE SOFTWARE. */ +#pragma once + #include "py/obj.h" #include "py/objtuple.h" +#include "shared-bindings/microcontroller/Pin.h" + typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; @@ -35,7 +39,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(void); +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(void); void alarm_pin_pinalarm_prepare_for_deep_sleep(void); void alarm_pin_pinalarm_reset(void); diff --git a/ports/espressif/common-hal/alarm/time/TimeAlarm.c b/ports/espressif/common-hal/alarm/time/TimeAlarm.c index f0daabc897..758e3c8f58 100644 --- a/ports/espressif/common-hal/alarm/time/TimeAlarm.c +++ b/ports/espressif/common-hal/alarm/time/TimeAlarm.c @@ -31,6 +31,7 @@ #include "components/esp_timer/include/esp_timer.h" +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/time/TimeAlarm.h" #include "shared-bindings/time/__init__.h" @@ -51,7 +52,9 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { +mp_obj_t alarm_time_timealarm_record_wake_alarm(void) { + alarm_time_timealarm_obj_t *const alarm = &alarm_wake_alarm.time_alarm; + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. alarm->monotonic_time = 0.0f; diff --git a/ports/espressif/common-hal/alarm/time/TimeAlarm.h b/ports/espressif/common-hal/alarm/time/TimeAlarm.h index edb4d0236f..c679c3cd9f 100644 --- a/ports/espressif/common-hal/alarm/time/TimeAlarm.h +++ b/ports/espressif/common-hal/alarm/time/TimeAlarm.h @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#pragma once #include "py/obj.h" @@ -33,7 +34,7 @@ typedef struct { } alarm_time_timealarm_obj_t; mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); +mp_obj_t alarm_time_timealarm_record_wake_alarm(void); void alarm_time_timealarm_reset(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c index 35da811ad9..232614ce32 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/touch/TouchAlarm.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" @@ -52,8 +53,9 @@ mp_obj_t alarm_touch_touchalarm_find_triggered_alarm(const size_t n_alarms, cons return mp_const_none; } -mp_obj_t alarm_touch_touchalarm_record_wakeup_alarm(alarm_touch_touchalarm_obj_t *alarm) { - // Create TouchAlarm object. +mp_obj_t alarm_touch_touchalarm_record_wake_alarm(void) { + alarm_touch_touchalarm_obj_t *const alarm = &alarm_wake_alarm.touch_alarm; + alarm->base.type = &alarm_touch_touchalarm_type; alarm->pin = NULL; diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.h b/ports/espressif/common-hal/alarm/touch/TouchAlarm.h index c5cb8da3e9..0f35063ee4 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.h +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H -#define MICROPY_INCLUDED_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H +#pragma once #include "py/obj.h" #include "common-hal/microcontroller/Pin.h" @@ -36,11 +35,9 @@ typedef struct { } alarm_touch_touchalarm_obj_t; mp_obj_t alarm_touch_touchalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_touch_touchalarm_record_wakeup_alarm(alarm_touch_touchalarm_obj_t *alarm); +mp_obj_t alarm_touch_touchalarm_record_wake_alarm(void); void alarm_touch_touchalarm_prepare_for_deep_sleep(void); void alarm_touch_touchalarm_reset(void); void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms); bool alarm_touch_touchalarm_woke_this_cycle(void); - -#endif // MICROPY_INCLUDED_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 54e2026c7d..3106f4b991 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -60,10 +60,6 @@ #include "peripherals/rmt.h" #include "peripherals/timer.h" -#if CIRCUITPY_ALARM -#include "common-hal/alarm/__init__.h" -#endif - #if CIRCUITPY_COUNTIO || CIRCUITPY_ROTARYIO || CIRCUITPY_FREQUENCYIO #include "peripherals/pcnt.h" #endif @@ -342,10 +338,6 @@ safe_mode_t port_init(void) { } void reset_port(void) { - #if CIRCUITPY_ALARM - alarm_reset(); - #endif - // TODO deinit for esp32-camera #if CIRCUITPY_ESP32_CAMERA esp_camera_deinit(); diff --git a/ports/nrf/common-hal/alarm/SleepMemory.h b/ports/nrf/common-hal/alarm/SleepMemory.h index 8fd702ea83..bb50c36e89 100644 --- a/ports/nrf/common-hal/alarm/SleepMemory.h +++ b/ports/nrf/common-hal/alarm/SleepMemory.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_ALARM_SLEEPMEMORY_H -#define MICROPY_INCLUDED_NRF_COMMON_HAL_ALARM_SLEEPMEMORY_H +#pragma once #include "py/obj.h" @@ -37,5 +36,3 @@ typedef struct { extern void set_memory_retention(void); extern void alarm_sleep_memory_reset(void); - -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_ALARM_SLEEPMEMORY_H diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 8501092c9d..b3f9979ae0 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -56,13 +56,9 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; -// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// Non-heap alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. // This object lives across VM instantiations, so none of these objects can contain references to the heap. -static union { - alarm_pin_pinalarm_obj_t pin_alarm; - alarm_time_timealarm_obj_t time_alarm; - alarm_touch_touchalarm_obj_t touch_alarm; -} wake_alarm; +alarm_wake_alarm_union_t alarm_wake_alarm; void alarm_reset(void) { alarm_sleep_memory_reset(); @@ -129,13 +125,13 @@ mp_obj_t common_hal_alarm_record_wake_alarm(void) { nrf_sleep_source_t cause = _get_wakeup_cause(); switch (cause) { case NRF_SLEEP_WAKEUP_TIMER: { - return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); + return alarm_time_timealarm_record_wake_alarm(); } case NRF_SLEEP_WAKEUP_TOUCHPAD: { - return alarm_touch_touchalarm_record_wakeup_alarm(&wake_alarm.touch_alarm); + return alarm_touch_touchalarm_record_wake_alarm(); } case NRF_SLEEP_WAKEUP_GPIO: { - return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm); + return alarm_pin_pinalarm_record_wake_alarm(); } default: break; diff --git a/ports/nrf/common-hal/alarm/__init__.h b/ports/nrf/common-hal/alarm/__init__.h index 47051dbd72..7c4634610d 100644 --- a/ports/nrf/common-hal/alarm/__init__.h +++ b/ports/nrf/common-hal/alarm/__init__.h @@ -25,10 +25,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_ALARM__INIT__H -#define MICROPY_INCLUDED_NRF_COMMON_HAL_ALARM__INIT__H +#pragma once #include "common-hal/alarm/SleepMemory.h" +#include "common-hal/alarm/pin/PinAlarm.h" +#include "common-hal/alarm/time/TimeAlarm.h" +#include "common-hal/alarm/touch/TouchAlarm.h" typedef enum { NRF_SLEEP_WAKEUP_UNDEFINED, @@ -40,6 +42,13 @@ typedef enum { NRF_SLEEP_WAKEUP_ZZZ } nrf_sleep_source_t; +typedef union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; + alarm_touch_touchalarm_obj_t touch_alarm; +} alarm_wake_alarm_union_t; + +extern alarm_wake_alarm_union_t alarm_wake_alarm; extern const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; enum { @@ -52,5 +61,3 @@ extern uint8_t sleepmem_wakeup_event; extern uint8_t sleepmem_wakeup_pin; extern void alarm_reset(void); - -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_ALARM__INIT__H diff --git a/ports/nrf/common-hal/alarm/pin/PinAlarm.c b/ports/nrf/common-hal/alarm/pin/PinAlarm.c index b48f0b46a7..5bef48773e 100644 --- a/ports/nrf/common-hal/alarm/pin/PinAlarm.c +++ b/ports/nrf/common-hal/alarm/pin/PinAlarm.c @@ -30,10 +30,9 @@ #include #include +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/pin/PinAlarm.h" #include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "common-hal/alarm/__init__.h" #include "nrfx.h" #include "nrf_gpio.h" @@ -101,7 +100,9 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) { +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(void) { + alarm_pin_pinalarm_obj_t *const alarm = &alarm_wake_alarm.pin_alarm; + alarm->base.type = &alarm_pin_pinalarm_type; alarm->pin = NULL; // Map the pin number back to a pin object. diff --git a/ports/nrf/common-hal/alarm/pin/PinAlarm.h b/ports/nrf/common-hal/alarm/pin/PinAlarm.h index 3a16a50d8a..9181cb6094 100644 --- a/ports/nrf/common-hal/alarm/pin/PinAlarm.h +++ b/ports/nrf/common-hal/alarm/pin/PinAlarm.h @@ -24,9 +24,13 @@ * THE SOFTWARE. */ +#pragma once + #include "py/obj.h" #include "py/objtuple.h" +#include "shared-bindings/microcontroller/Pin.h" + typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; @@ -35,7 +39,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm); +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(void); void alarm_pin_pinalarm_reset(void); void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/nrf/common-hal/alarm/time/TimeAlarm.c b/ports/nrf/common-hal/alarm/time/TimeAlarm.c index af1ce694ee..a69e299bc2 100644 --- a/ports/nrf/common-hal/alarm/time/TimeAlarm.c +++ b/ports/nrf/common-hal/alarm/time/TimeAlarm.c @@ -28,7 +28,7 @@ #include "py/runtime.h" #include -#include "common-hal/alarm/__init__.h" +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/time/TimeAlarm.h" #include "shared-bindings/time/__init__.h" @@ -49,7 +49,9 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { +mp_obj_t alarm_time_timealarm_record_wake_alarm(void) { + alarm_time_timealarm_obj_t *const alarm = &alarm_wake_alarm.time_alarm; + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. alarm->monotonic_time = 0.0f; diff --git a/ports/nrf/common-hal/alarm/time/TimeAlarm.h b/ports/nrf/common-hal/alarm/time/TimeAlarm.h index 2af5121e10..c5f76c8003 100644 --- a/ports/nrf/common-hal/alarm/time/TimeAlarm.h +++ b/ports/nrf/common-hal/alarm/time/TimeAlarm.h @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#pragma once #include "py/obj.h" @@ -37,7 +38,7 @@ extern void port_disable_interrupt_after_ticks_ch(uint32_t channel); extern void port_interrupt_after_ticks_ch(uint32_t channel, uint32_t ticks); mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); +mp_obj_t alarm_time_timealarm_record_wake_alarm(void); bool alarm_time_timealarm_woke_this_cycle(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/nrf/common-hal/alarm/touch/TouchAlarm.c b/ports/nrf/common-hal/alarm/touch/TouchAlarm.c index 9bd2fefcce..5c1d489262 100644 --- a/ports/nrf/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/nrf/common-hal/alarm/touch/TouchAlarm.c @@ -25,6 +25,7 @@ */ #include "py/runtime.h" + #include "shared-bindings/alarm/touch/TouchAlarm.h" #include "shared-bindings/microcontroller/__init__.h" @@ -39,7 +40,7 @@ mp_obj_t alarm_touch_touchalarm_find_triggered_alarm(const size_t n_alarms, cons return mp_const_none; } -mp_obj_t alarm_touch_touchalarm_record_wakeup_alarm(alarm_touch_touchalarm_obj_t *alarm) { +mp_obj_t alarm_touch_touchalarm_record_wake_alarm(void) { return mp_const_none; } diff --git a/ports/nrf/common-hal/alarm/touch/TouchAlarm.h b/ports/nrf/common-hal/alarm/touch/TouchAlarm.h index d895414cd3..31aa30117a 100644 --- a/ports/nrf/common-hal/alarm/touch/TouchAlarm.h +++ b/ports/nrf/common-hal/alarm/touch/TouchAlarm.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H -#define MICROPY_INCLUDED_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H +#pragma once #include "py/obj.h" #include "common-hal/microcontroller/Pin.h" @@ -37,11 +36,9 @@ typedef struct { // Find the alarm object that caused us to wake up or create an equivalent one. mp_obj_t alarm_touch_touchalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_touch_touchalarm_record_wakeup_alarm(void); +mp_obj_t alarm_touch_touchalarm_record_wake_alarm(void); // Check for the wake up alarm from pretend deep sleep. void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms); void alarm_touch_touchalarm_prepare_for_deep_sleep(void); bool alarm_touch_touchalarm_woke_this_cycle(void); void alarm_touch_touchalarm_reset(void); - -#endif // MICROPY_INCLUDED_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 477829c2d2..e67f641900 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -64,15 +64,11 @@ #include "lib/tinyusb/src/device/usbd.h" -#if CIRCUITPY_ALARM -#include "common-hal/alarm/__init__.h" -#endif - -#ifdef CIRCUITPY_AUDIOBUSIO +#if CIRCUITPY_AUDIOBUSIO #include "common-hal/audiobusio/I2SOut.h" #endif -#ifdef CIRCUITPY_AUDIOPWMIO +#if CIRCUITPY_AUDIOPWMIO #include "common-hal/audiopwmio/PWMAudioOut.h" #endif @@ -216,10 +212,6 @@ safe_mode_t port_init(void) { } void reset_port(void) { - #if CIRCUITPY_ALARM - alarm_reset(); - #endif - #if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); diff --git a/ports/raspberrypi/common-hal/alarm/SleepMemory.h b/ports/raspberrypi/common-hal/alarm/SleepMemory.h index 59d0429c3b..14848cd5a0 100644 --- a/ports/raspberrypi/common-hal/alarm/SleepMemory.h +++ b/ports/raspberrypi/common-hal/alarm/SleepMemory.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM_SLEEPMEMORY_H -#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM_SLEEPMEMORY_H +#pragma once #include "py/obj.h" @@ -34,5 +33,3 @@ typedef struct { } alarm_sleep_memory_obj_t; extern void alarm_sleep_memory_reset(void); - -#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM_SLEEPMEMORY_H diff --git a/ports/raspberrypi/common-hal/alarm/__init__.c b/ports/raspberrypi/common-hal/alarm/__init__.c index c184ab95d9..656d15af5a 100644 --- a/ports/raspberrypi/common-hal/alarm/__init__.c +++ b/ports/raspberrypi/common-hal/alarm/__init__.c @@ -96,12 +96,9 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; -// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// Non-heap alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. // This object lives across VM instantiations, so none of these objects can contain references to the heap. -static union { - alarm_pin_pinalarm_obj_t pin_alarm; - alarm_time_timealarm_obj_t time_alarm; -} wake_alarm; +alarm_wake_alarm_union_t alarm_wake_alarm; void alarm_reset(void) { alarm_sleep_memory_reset(); @@ -144,11 +141,11 @@ mp_obj_t common_hal_alarm_record_wake_alarm(void) { uint8_t cause = _get_wakeup_cause(); switch (cause) { case RP_SLEEP_WAKEUP_RTC: { - return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); + return alarm_time_timealarm_record_wake_alarm(); } case RP_SLEEP_WAKEUP_GPIO: { - return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm); + return alarm_pin_pinalarm_record_wake_alarm(); } case RP_SLEEP_WAKEUP_UNDEF: diff --git a/ports/raspberrypi/common-hal/alarm/__init__.h b/ports/raspberrypi/common-hal/alarm/__init__.h index 3d5d86f8dc..284e3ddb4e 100644 --- a/ports/raspberrypi/common-hal/alarm/__init__.h +++ b/ports/raspberrypi/common-hal/alarm/__init__.h @@ -24,10 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM__INIT__H -#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM__INIT__H +#pragma once #include "common-hal/alarm/SleepMemory.h" +#include "common-hal/alarm/pin/PinAlarm.h" +#include "common-hal/alarm/time/TimeAlarm.h" #include "hardware/regs/clocks.h" @@ -35,8 +36,12 @@ #define RP_SLEEP_WAKEUP_GPIO 1 #define RP_SLEEP_WAKEUP_RTC 2 +typedef union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; +} alarm_wake_alarm_union_t; + +extern alarm_wake_alarm_union_t alarm_wake_alarm; extern const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; extern void alarm_reset(void); - -#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM__INIT__H diff --git a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c index 388cba3d8a..0af27cb44f 100644 --- a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c +++ b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c @@ -26,10 +26,10 @@ #include "py/runtime.h" +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/pin/PinAlarm.h" #include "shared-bindings/microcontroller/__init__.h" #include "common-hal/microcontroller/__init__.h" -#include "shared-bindings/microcontroller/Pin.h" #include "pico/stdlib.h" #include "hardware/gpio.h" @@ -94,7 +94,9 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) { +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(void) { + alarm_pin_pinalarm_obj_t *const alarm = &alarm_wake_alarm.pin_alarm; + alarm->base.type = &alarm_pin_pinalarm_type; // TODO: how to obtain the correct pin from memory? alarm->pin = NULL; diff --git a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h index 1e576b9382..9dcbf2b848 100644 --- a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h +++ b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h @@ -24,9 +24,13 @@ * THE SOFTWARE. */ +#pragma once + #include "py/obj.h" #include "py/objtuple.h" +#include "shared-bindings/microcontroller/Pin.h" + typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; @@ -36,7 +40,7 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm); +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(void); void alarm_pin_pinalarm_reset(void); void alarm_pin_pinalarm_light_reset(void); diff --git a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c index 81eb78bcb1..9bfe5cf262 100644 --- a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c +++ b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c @@ -26,6 +26,7 @@ #include "py/runtime.h" +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/time/TimeAlarm.h" #include "shared-bindings/time/__init__.h" @@ -58,7 +59,9 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { +mp_obj_t alarm_time_timealarm_record_wake_alarm(void) { + alarm_time_timealarm_obj_t *const alarm = &alarm_wake_alarm.time_alarm; + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. alarm->monotonic_time = 0.0f; diff --git a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.h b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.h index 4d5569a569..0b4c8bce06 100644 --- a/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.h +++ b/ports/raspberrypi/common-hal/alarm/time/TimeAlarm.h @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#pragma once #include "py/obj.h" @@ -33,7 +34,7 @@ typedef struct { } alarm_time_timealarm_obj_t; mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); +mp_obj_t alarm_time_timealarm_record_wake_alarm(void); void alarm_time_timealarm_reset(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); diff --git a/ports/raspberrypi/common-hal/alarm/touch/TouchAlarm.h b/ports/raspberrypi/common-hal/alarm/touch/TouchAlarm.h index f631293511..6badde145f 100644 --- a/ports/raspberrypi/common-hal/alarm/touch/TouchAlarm.h +++ b/ports/raspberrypi/common-hal/alarm/touch/TouchAlarm.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H -#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H +#pragma once #include "py/obj.h" #include "common-hal/microcontroller/Pin.h" @@ -34,5 +33,3 @@ typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; } alarm_touch_touchalarm_obj_t; - -#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ALARM_TOUCH_TOUCHALARM_H diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index d1eff62d56..781d2b11d2 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -41,10 +41,6 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/pwmio/PWMOut.h" -#if CIRCUITPY_ALARM -#include "common-hal/alarm/__init__.h" -#endif - #if CIRCUITPY_SSL #include "common-hal/ssl/__init__.h" #endif @@ -158,10 +154,6 @@ safe_mode_t port_init(void) { } void reset_port(void) { - #if CIRCUITPY_ALARM - alarm_reset(); - #endif - #if CIRCUITPY_BUSIO reset_i2c(); reset_spi(); diff --git a/ports/stm/common-hal/alarm/SleepMemory.h b/ports/stm/common-hal/alarm/SleepMemory.h index 0e9fc54904..14848cd5a0 100644 --- a/ports/stm/common-hal/alarm/SleepMemory.h +++ b/ports/stm/common-hal/alarm/SleepMemory.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_SLEEPMEMORY_H -#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_SLEEPMEMORY_H +#pragma once #include "py/obj.h" @@ -34,5 +33,3 @@ typedef struct { } alarm_sleep_memory_obj_t; extern void alarm_sleep_memory_reset(void); - -#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_SLEEPMEMORY_H diff --git a/ports/stm/common-hal/alarm/__init__.c b/ports/stm/common-hal/alarm/__init__.c index 4763403842..78d50b41a8 100644 --- a/ports/stm/common-hal/alarm/__init__.c +++ b/ports/stm/common-hal/alarm/__init__.c @@ -47,12 +47,9 @@ const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { }, }; -// Static alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. +// Non-heap alarm object recording alarm (if any) that woke up CircuitPython after light or deep sleep. // This object lives across VM instantiations, so none of these objects can contain references to the heap. -static union { - alarm_pin_pinalarm_obj_t pin_alarm; - alarm_time_timealarm_obj_t time_alarm; -} wake_alarm; +alarm_wake_alarm_union_t alarm_wake_alarm; STATIC stm_sleep_source_t true_deep_wake_reason; @@ -94,10 +91,10 @@ mp_obj_t common_hal_alarm_record_wake_alarm(void) { stm_sleep_source_t cause = alarm_get_wakeup_cause(); switch (cause) { case STM_WAKEUP_RTC: { - return alarm_time_timealarm_record_wakeup_alarm(&wake_alarm.time_alarm); + return alarm_time_timealarm_record_wake_alarm(); } case STM_WAKEUP_GPIO: { - return alarm_pin_pinalarm_record_wakeup_alarm(&wake_alarm.pin_alarm); + return alarm_pin_pinalarm_record_wake_alarm(); } case STM_WAKEUP_UNDEF: default: diff --git a/ports/stm/common-hal/alarm/__init__.h b/ports/stm/common-hal/alarm/__init__.h index 6c72364fc3..c87cb3b1eb 100644 --- a/ports/stm/common-hal/alarm/__init__.h +++ b/ports/stm/common-hal/alarm/__init__.h @@ -24,10 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM__INIT__H -#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM__INIT__H +#pragma once #include "common-hal/alarm/SleepMemory.h" +#include "common-hal/alarm/pin/PinAlarm.h" +#include "common-hal/alarm/time/TimeAlarm.h" extern const alarm_sleep_memory_obj_t alarm_sleep_memory_obj; @@ -37,10 +38,15 @@ typedef enum { STM_WAKEUP_RTC } stm_sleep_source_t; +typedef union { + alarm_pin_pinalarm_obj_t pin_alarm; + alarm_time_timealarm_obj_t time_alarm; +} alarm_wake_alarm_union_t; + +extern alarm_wake_alarm_union_t alarm_wake_alarm; + #define STM_ALARM_FLAG (RTC->BKP0R) extern void alarm_set_wakeup_reason(stm_sleep_source_t reason); -stm_sleep_source_t alarm_get_wakeup_cause(void); +extern stm_sleep_source_t alarm_get_wakeup_cause(void); extern void alarm_reset(void); - -#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM__INIT__H diff --git a/ports/stm/common-hal/alarm/pin/PinAlarm.c b/ports/stm/common-hal/alarm/pin/PinAlarm.c index 50bd06b59a..161bd9fea6 100644 --- a/ports/stm/common-hal/alarm/pin/PinAlarm.c +++ b/ports/stm/common-hal/alarm/pin/PinAlarm.c @@ -26,6 +26,7 @@ #include "py/runtime.h" +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/pin/PinAlarm.h" #include "peripherals/exti.h" @@ -100,7 +101,9 @@ mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t return mp_const_none; } -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm) { +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(void) { + alarm_pin_pinalarm_obj_t *const alarm = &alarm_wake_alarm.pin_alarm; + alarm->base.type = &alarm_pin_pinalarm_type; // TODO: replace this if/when other WKUP pins are supported alarm->pin = &pin_PA00; diff --git a/ports/stm/common-hal/alarm/pin/PinAlarm.h b/ports/stm/common-hal/alarm/pin/PinAlarm.h index 1490944fdf..77e0c6143e 100644 --- a/ports/stm/common-hal/alarm/pin/PinAlarm.h +++ b/ports/stm/common-hal/alarm/pin/PinAlarm.h @@ -24,12 +24,13 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_PINALARM_H -#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_PINALARM_H +#pragma once #include "py/obj.h" #include "py/objtuple.h" +#include "shared-bindings/microcontroller/Pin.h" + typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; @@ -38,11 +39,9 @@ typedef struct { } alarm_pin_pinalarm_obj_t; mp_obj_t alarm_pin_pinalarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_pin_pinalarm_record_wakeup_alarm(alarm_pin_pinalarm_obj_t *alarm); +mp_obj_t alarm_pin_pinalarm_record_wake_alarm(void); void alarm_pin_pinalarm_reset(void); void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); void alarm_pin_pinalarm_prepare_for_deep_sleep(void); bool alarm_pin_pinalarm_woke_this_cycle(void); - -#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_PINALARM_H diff --git a/ports/stm/common-hal/alarm/time/TimeAlarm.c b/ports/stm/common-hal/alarm/time/TimeAlarm.c index a1ebd3fa05..9ba6ed7658 100644 --- a/ports/stm/common-hal/alarm/time/TimeAlarm.c +++ b/ports/stm/common-hal/alarm/time/TimeAlarm.c @@ -26,6 +26,7 @@ #include "py/runtime.h" +#include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/time/TimeAlarm.h" #include "shared-bindings/time/__init__.h" #include "peripherals/rtc.h" @@ -53,7 +54,9 @@ mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj return mp_const_none; } -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm) { +mp_obj_t alarm_time_timealarm_record_wake_alarm(void) { + alarm_time_timealarm_obj_t *const alarm = &alarm_wake_alarm.time_alarm; + alarm->base.type = &alarm_time_timealarm_type; // TODO: Set monotonic_time based on the RTC state. alarm->monotonic_time = 0.0f; diff --git a/ports/stm/common-hal/alarm/time/TimeAlarm.h b/ports/stm/common-hal/alarm/time/TimeAlarm.h index 05e77a90be..e3b9caadcd 100644 --- a/ports/stm/common-hal/alarm/time/TimeAlarm.h +++ b/ports/stm/common-hal/alarm/time/TimeAlarm.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TIMEALARM_H -#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TIMEALARM_H +#pragma once #include "py/obj.h" @@ -35,12 +34,10 @@ typedef struct { } alarm_time_timealarm_obj_t; mp_obj_t alarm_time_timealarm_find_triggered_alarm(size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_time_timealarm_record_wakeup_alarm(alarm_time_timealarm_obj_t *alarm); +mp_obj_t alarm_time_timealarm_record_wake_alarm(void); bool alarm_time_timealarm_woke_this_cycle(void); void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); void alarm_time_timealarm_reset(void); void alarm_time_timealarm_prepare_for_deep_sleep(void); - -#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TIMEALARM_H diff --git a/ports/stm/common-hal/alarm/touch/TouchAlarm.h b/ports/stm/common-hal/alarm/touch/TouchAlarm.h index 6c89353f93..59f202c69d 100644 --- a/ports/stm/common-hal/alarm/touch/TouchAlarm.h +++ b/ports/stm/common-hal/alarm/touch/TouchAlarm.h @@ -24,12 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TOUCHALARM_H -#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TOUCHALARM_H +#pragma once typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; } alarm_touch_touchalarm_obj_t; - -#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM_TOUCHALARM_H diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index adfce78cba..97bd1c4982 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -33,10 +33,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" -#if CIRCUITPY_ALARM -#include "common-hal/alarm/__init__.h" -#endif -#if CIRCUITPY_AUDIOPWMIO +#ifdef CIRCUITPY_AUDIOPWMIO #include "common-hal/audiopwmio/PWMAudioOut.h" #endif #if CIRCUITPY_BUSIO @@ -60,6 +57,9 @@ #if CIRCUITPY_PULSEIO || CIRCUITPY_ALARM #include "peripherals/exti.h" #endif +#if CIRCUITPY_ALARM +#include "common-hal/alarm/__init__.h" +#endif #if CIRCUITPY_RTC #include "shared-bindings/rtc/__init__.h" #endif @@ -244,10 +244,6 @@ void SysTick_Handler(void) { void reset_port(void) { reset_all_pins(); - #if CIRCUITPY_ALARM - alarm_reset(); - #endif - #if CIRCUITPY_RTC rtc_reset(); #endif From 3f2e8feb5c0a0ecdcb5356b3c838141044a13104 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sat, 29 Oct 2022 20:31:04 +0000 Subject: [PATCH 020/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1005 of 1005 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 94f13567da..3f50364a68 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-10-29 18:16+0000\n" +"PO-Revision-Date: 2022-10-29 22:00+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -3951,7 +3951,7 @@ msgstr "pressionando ambos os botões durante a inicialização.\n" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "pressing central button at start up.\n" -msgstr "" +msgstr "pressionando o botão central na inicialização.\n" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h From c6cfb031d083ec926a5541a70d46fe367e8587b8 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sat, 29 Oct 2022 18:33:41 +0000 Subject: [PATCH 021/357] Translated using Weblate (Swedish) Currently translated at 100.0% (1005 of 1005 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 28cf8f6693..ae47e52f1f 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-10-29 18:16+0000\n" +"PO-Revision-Date: 2022-10-29 22:00+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -3912,7 +3912,7 @@ msgstr "genom att trycka båda knapparna vid uppstart.\n" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "pressing central button at start up.\n" -msgstr "" +msgstr "trycka på mittknappen vid start.\n" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h From 5d7c58da5db472de09f9c38adbb63222d0687067 Mon Sep 17 00:00:00 2001 From: dronecz Date: Sun, 30 Oct 2022 01:52:09 +0200 Subject: [PATCH 022/357] Update pins.c Attempt to fix build issue --- ports/espressif/boards/maker_badge/pins.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/espressif/boards/maker_badge/pins.c b/ports/espressif/boards/maker_badge/pins.c index f573b20be8..abecb7fef3 100644 --- a/ports/espressif/boards/maker_badge/pins.c +++ b/ports/espressif/boards/maker_badge/pins.c @@ -82,6 +82,5 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 934d2a7004a98879b9a1a39019b640db19fd17da Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sat, 29 Oct 2022 05:30:22 +0200 Subject: [PATCH 023/357] remove duplicate press boot button, it's already the default --- ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h | 3 --- .../boards/adafruit_qtpy_esp32_pico/mpconfigboard.h | 3 --- ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h | 3 --- ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h | 3 --- .../boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h | 2 -- ports/espressif/boards/lolin_c3_mini/mpconfigboard.h | 3 --- ports/espressif/boards/microdev_micro_c3/mpconfigboard.h | 3 --- .../boards/unexpectedmaker_tinypico/mpconfigboard.h | 5 ----- .../boards/unexpectedmaker_tinypico_nano/mpconfigboard.h | 5 ----- 9 files changed, 30 deletions(-) diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h index bb99c412ae..1886f9e233 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h @@ -5,9 +5,6 @@ #define CALIBRATE_CRYSTALLESS 1 -// Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons at start up.\n") - #define DEFAULT_I2C_BUS_SCL (&pin_PA08) #define DEFAULT_I2C_BUS_SDA (&pin_PA09) diff --git a/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h b/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h index 42a575aa68..7f8288f17b 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h @@ -41,9 +41,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -// Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing BOOT button at start up.\n") - // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) #define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h b/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h index 0cc6509647..32b0940881 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h @@ -44,7 +44,4 @@ // For entering safe mode #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) -// Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") - #define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h b/ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h index 3b1caff2e9..2cdf48fad3 100644 --- a/ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +++ b/ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h @@ -41,7 +41,4 @@ #define CIRCUITPY_BOARD_UART (1) #define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} -// Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") - #define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h index 51fb60fe1a..4875dcc745 100644 --- a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h +++ b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h @@ -35,5 +35,3 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO44) #define DEFAULT_UART_BUS_TX (&pin_GPIO43) - -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h index 03e4d5d436..2a90d91845 100644 --- a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h @@ -45,7 +45,4 @@ #define CIRCUITPY_BOARD_UART (1) #define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} -// Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") - #define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h index 97a18f3235..2153513306 100644 --- a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h +++ b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h @@ -50,6 +50,3 @@ // For entering safe mode #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) - -// Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") diff --git a/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.h index a12ccb0c18..2db308f623 100644 --- a/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.h +++ b/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.h @@ -33,11 +33,6 @@ #define CIRCUITPY_BOARD_SPI (1) #define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} -// #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) - -// Explanation of how a user got into safe mode -// #define BOARD_USER_SAFE_MODE_ACTION translate("pressing BOOT button at start up.\n") - // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) #define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.h index 3cc64859ce..87c582b3bf 100644 --- a/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.h +++ b/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.h @@ -33,11 +33,6 @@ #define CIRCUITPY_BOARD_SPI (1) #define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} -// #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) - -// Explanation of how a user got into safe mode -// #define BOARD_USER_SAFE_MODE_ACTION translate("pressing BOOT button at start up.\n") - // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) #define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) From 0aa41fa92efdcb095d26b1202dedeaaec4c3cc6f Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sat, 29 Oct 2022 05:31:12 +0200 Subject: [PATCH 024/357] change BOARD_USER_SAFE_MODE_ACTION into a separate sentence --- locale/circuitpython.pot | 74 ++++++++----------- .../circuitplayground_express/mpconfigboard.h | 2 +- .../mpconfigboard.h | 2 +- .../mpconfigboard.h | 2 +- .../boards/meowmeow/mpconfigboard.h | 2 +- .../adafruit_feather_esp32_v2/mpconfigboard.h | 2 +- .../hardkernel_odroid_go/mpconfigboard.h | 2 +- .../boards/m5stack_atom_lite/mpconfigboard.h | 2 +- .../boards/m5stack_core_basic/mpconfigboard.h | 2 +- .../boards/m5stack_core_fire/mpconfigboard.h | 2 +- .../nrf/boards/aramcon2_badge/mpconfigboard.h | 2 +- supervisor/shared/safe_mode.c | 5 +- 12 files changed, 42 insertions(+), 57 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 9537a28bdd..b880087884 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -583,6 +583,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -648,6 +655,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "" @@ -1975,18 +1987,34 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2047,7 +2075,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2345,10 +2373,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - #: py/objtype.c msgid "__init__() should return None" msgstr "" @@ -3815,46 +3839,8 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" +msgid "The central button was pressed at start up.\n" msgstr "" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index 9020c243b1..33910221a0 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -23,7 +23,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("Both buttons were pressed at start up.\n") // Increase stack size slightly due to CPX library import nesting #define CIRCUITPY_DEFAULT_STACK_SIZE (4248) // divisible by 8 diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index 5073c5e403..7f0e041f25 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -23,7 +23,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("Both buttons were pressed at start up.\n") // Increase stack size slightly due to CPX library import nesting #define CIRCUITPY_DEFAULT_STACK_SIZE (4248) // divisible by 8 diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index 20cfc617a2..12fd30e005 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -23,7 +23,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("Both buttons were pressed at start up.\n") // Increase stack size slightly due to CPX library import nesting. #define CIRCUITPY_DEFAULT_STACK_SIZE (4248) // divisible by 8 diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h index 73853dab5d..ad6901230f 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h @@ -6,7 +6,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("Both buttons were pressed at start up.\n") #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h index fc478ef005..b7f2513217 100644 --- a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h @@ -47,7 +47,7 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO38) // Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing SW38 button at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("The SW38 button was pressed at start up.\n") // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) diff --git a/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h b/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h index 423890f2e1..7de90b0ae8 100644 --- a/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +++ b/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h @@ -35,7 +35,7 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) // Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing VOLUME button at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("The VOLUME button was pressed at start up.\n") // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) diff --git a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h index fdc79ec744..dfa12b53b0 100644 --- a/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +++ b/ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h @@ -42,7 +42,7 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO39) // Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing central button at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("The central button was pressed at start up.\n") // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) diff --git a/ports/espressif/boards/m5stack_core_basic/mpconfigboard.h b/ports/espressif/boards/m5stack_core_basic/mpconfigboard.h index 6ea8e508d4..c974c64874 100755 --- a/ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +++ b/ports/espressif/boards/m5stack_core_basic/mpconfigboard.h @@ -42,7 +42,7 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO39) // Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing button A at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("Button A was pressed at start up.\n") // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) diff --git a/ports/espressif/boards/m5stack_core_fire/mpconfigboard.h b/ports/espressif/boards/m5stack_core_fire/mpconfigboard.h index 8c389a641d..f56a8fe901 100755 --- a/ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +++ b/ports/espressif/boards/m5stack_core_fire/mpconfigboard.h @@ -43,7 +43,7 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO39) // Explanation of how a user got into safe mode -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing button A at start up.\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("Button A was pressed at start up.\n") // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) diff --git a/ports/nrf/boards/aramcon2_badge/mpconfigboard.h b/ports/nrf/boards/aramcon2_badge/mpconfigboard.h index 517ad7324b..af8e3c3507 100644 --- a/ports/nrf/boards/aramcon2_badge/mpconfigboard.h +++ b/ports/nrf/boards/aramcon2_badge/mpconfigboard.h @@ -52,7 +52,7 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_P0_29) -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing the left button at start up\n") +#define BOARD_USER_SAFE_MODE_ACTION translate("The left button was pressed at start up.\n") #define CIRCUITPY_INTERNAL_NVM_SIZE (4096) diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index aefae1e48b..64391059d3 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -149,13 +149,12 @@ void print_safe_mode_message(safe_mode_t reason) { #ifdef BOARD_USER_SAFE_MODE_ACTION message = BOARD_USER_SAFE_MODE_ACTION; #elif defined(CIRCUITPY_BOOT_BUTTON) - message = translate("pressing boot button at start up.\n"); + message = translate("The BOOT button was pressed at start up.\n"); #endif if (message != NULL) { // Output a user safe mode string if it's set. - serial_write_compressed(translate("You requested starting safe mode by ")); serial_write_compressed(message); - serial_write_compressed(translate("To exit, please reset the board without ")); + message = translate("To exit, please reset the board without requesting safe mode."); // The final piece is printed below. } break; From ae8f415bd59db285f81d84935f0ab923f21bd024 Mon Sep 17 00:00:00 2001 From: dronecz Date: Sun, 30 Oct 2022 02:17:38 +0200 Subject: [PATCH 025/357] Update board.c --- ports/espressif/boards/maker_badge/board.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/espressif/boards/maker_badge/board.c b/ports/espressif/boards/maker_badge/board.c index 4b244087f6..19dba31c57 100644 --- a/ports/espressif/boards/maker_badge/board.c +++ b/ports/espressif/boards/maker_badge/board.c @@ -49,8 +49,6 @@ void board_init(void) { } -// busio_spi_obj_t *spi = common_hal_board_create_spi(); - bool board_requests_safe_mode(void) { return false; } From 8f82db5b22299c7a2fe16c80c54e7cc26594a2bd Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 30 Oct 2022 03:55:59 +0100 Subject: [PATCH 026/357] define out the safe mode message if none --- locale/circuitpython.pot | 8 ++++---- supervisor/shared/safe_mode.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b880087884..768daa8651 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2011,6 +2011,10 @@ msgid "" "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "The left button was pressed at start up.\n" msgstr "" @@ -3839,10 +3843,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "The central button was pressed at start up.\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 64391059d3..d23b78d624 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -146,17 +146,17 @@ void print_safe_mode_message(safe_mode_t reason) { switch (reason) { case USER_SAFE_MODE: - #ifdef BOARD_USER_SAFE_MODE_ACTION + #if defined(BOARD_USER_SAFE_MODE_ACTION) message = BOARD_USER_SAFE_MODE_ACTION; #elif defined(CIRCUITPY_BOOT_BUTTON) message = translate("The BOOT button was pressed at start up.\n"); #endif - if (message != NULL) { - // Output a user safe mode string if it's set. - serial_write_compressed(message); - message = translate("To exit, please reset the board without requesting safe mode."); - // The final piece is printed below. - } + #if defined(BOARD_USER_SAFE_MODE_ACTION) || defined(CIRCUITPY_BOOT_BUTTON) + // Output a user safe mode string if it's set. + serial_write_compressed(message); + message = translate("To exit, please reset the board without requesting safe mode."); + // The final piece is printed below. + #endif break; case MANUAL_SAFE_MODE: message = translate("You pressed the reset button during boot. Press again to exit safe mode."); From 1d1cb1fe36d006a7dfe1d0749dff5edcd03fbb67 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sun, 30 Oct 2022 11:24:25 +0100 Subject: [PATCH 027/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 88 ++++++++++++++---------------- locale/cs.po | 80 ++++++++++++---------------- locale/de_DE.po | 106 +++++++++++++++++++----------------- locale/el.po | 80 ++++++++++++---------------- locale/en_GB.po | 97 ++++++++++++++++----------------- locale/es.po | 97 ++++++++++++++++----------------- locale/fil.po | 88 ++++++++++++++---------------- locale/fr.po | 106 +++++++++++++++++++----------------- locale/hi.po | 80 ++++++++++++---------------- locale/it_IT.po | 88 ++++++++++++++---------------- locale/ja.po | 80 ++++++++++++---------------- locale/ko.po | 80 ++++++++++++---------------- locale/nl.po | 94 ++++++++++++++++---------------- locale/pl.po | 88 ++++++++++++++---------------- locale/pt_BR.po | 112 ++++++++++++++++++++++----------------- locale/ru.po | 80 ++++++++++++---------------- locale/sv.po | 112 ++++++++++++++++++++++----------------- locale/tr.po | 80 ++++++++++++---------------- locale/zh_Latn_pinyin.po | 106 +++++++++++++++++++----------------- 19 files changed, 837 insertions(+), 905 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 5947e6698d..6741923b7d 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -591,6 +591,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Kedua pin harus mendukung hardware interrut" @@ -656,6 +663,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "Pin bus %d sudah digunakan" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer harus 16 byte." @@ -2004,18 +2016,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "Waktu baca suhu habis" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2076,8 +2108,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Untuk keluar, silahkan reset board tanpa " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2376,10 +2408,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Anda mengajukan untuk memulai mode aman pada (safe mode) pada " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init __() harus mengembalikan None" @@ -3847,48 +3875,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" @@ -4409,6 +4395,12 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "To exit, please reset the board without " +#~ msgstr "Untuk keluar, silahkan reset board tanpa " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Anda mengajukan untuk memulai mode aman pada (safe mode) pada " + #~ msgid "Stream missing readinto() or write() method." #~ msgstr "Aliran tidak menemukan metode readinto() atau write()." diff --git a/locale/cs.po b/locale/cs.po index d1db5450f2..9159489fe5 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -592,6 +592,13 @@ msgstr "Bootovací zařízení musí být první (rozhraní #0)." msgid "Both RX and TX required for flow control" msgstr "RX a TX jsou vyžadovány pro kontrolu toku" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Oba piny musí podporovat hardwarové přerušení" @@ -657,6 +664,11 @@ msgstr "Buffery musí mít stejnou velikost" msgid "Bus pin %d is already in use" msgstr "Sběrnicový pin %d je již používán" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Bajtový buffer musí být 16 bajtů." @@ -1993,18 +2005,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2065,7 +2097,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2363,10 +2395,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - #: py/objtype.c msgid "__init__() should return None" msgstr "" @@ -3833,48 +3861,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index b5f9d29836..bb53013fac 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -595,6 +595,13 @@ msgstr "Boot-Gerät muss erstes Gerät sein (interface #0)." msgid "Both RX and TX required for flow control" msgstr "Sowohl RX als auch TX sind zu Flusssteuerung erforderlich" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Beide Pins müssen Hardware-Interrupts unterstützen" @@ -660,6 +667,11 @@ msgstr "Buffers müssen gleiche Größe haben" msgid "Bus pin %d is already in use" msgstr "Bus-Pin %d wird schon benutzt" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Der Puffer muss 16 Bytes lang sein." @@ -2018,6 +2030,10 @@ msgstr "Systemeintrag muss auf gnss.SatelliteSystem lauten" msgid "Temperature read timed out" msgstr "Zeitüberschreitung beim Auslesen der Temperatur" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -2026,6 +2042,14 @@ msgstr "" "Der Heap von CircuitPython wurde beschädigt, weil der Stack zu klein war.\n" "Vergrößern Sie den Stack, wenn Sie wissen, wie. Wenn nicht:" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " @@ -2034,6 +2058,14 @@ msgstr "" "Das Modul `microcontroller` wurde zum Booten in den abgesicherten Modus " "verwendet. Drücken Sie Reset, um den abgesicherten Modus zu verlassen." +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "Die Länge von rgb_pins muss 6, 12, 18, 24 oder 30 betragen" @@ -2103,8 +2135,8 @@ msgstr "" "Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Zum beenden, resette bitte das board ohne " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2417,10 +2449,6 @@ msgstr "" "Du hast beim Booten die Reset-Taste gedrückt. Drücke sie erneut, um den " "abgesicherten Modus zu beenden." -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Du hast das Starten im abgesicherten Modus ausgelöst durch " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init__() sollte None zurückgeben" @@ -3914,48 +3942,6 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "pow() mit 3 Argumenten erfordert Integer" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "BOOT Taste wird beim Starten gedrückt.\n" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "SW38 Taste wird beim Starten gedrückt.\n" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "VOLUME Taste wird beim Starten gedrückt.\n" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "Drücken der Boot-Taste beim Start.\n" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "Drücken Sie beim Start beide Tasten.\n" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "Drücken der linken Taste beim Einschalten\n" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "Pull-Masken kollidieren mit Richtungsmasken" @@ -4479,6 +4465,30 @@ 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 "To exit, please reset the board without " +#~ msgstr "Zum beenden, resette bitte das board ohne " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Du hast das Starten im abgesicherten Modus ausgelöst durch " + +#~ msgid "pressing BOOT button at start up.\n" +#~ msgstr "BOOT Taste wird beim Starten gedrückt.\n" + +#~ msgid "pressing SW38 button at start up.\n" +#~ msgstr "SW38 Taste wird beim Starten gedrückt.\n" + +#~ msgid "pressing VOLUME button at start up.\n" +#~ msgstr "VOLUME Taste wird beim Starten gedrückt.\n" + +#~ msgid "pressing boot button at start up.\n" +#~ msgstr "Drücken der Boot-Taste beim Start.\n" + +#~ msgid "pressing both buttons at start up.\n" +#~ msgstr "Drücken Sie beim Start beide Tasten.\n" + +#~ msgid "pressing the left button at start up\n" +#~ msgstr "Drücken der linken Taste beim Einschalten\n" + #~ msgid "Only one TouchAlarm can be set in deep sleep." #~ msgstr "Nur ein TouchAlarm kann in Deep Sleep gesetzt werden." diff --git a/locale/el.po b/locale/el.po index 202fcaf4c5..59e69f257f 100644 --- a/locale/el.po +++ b/locale/el.po @@ -598,6 +598,13 @@ msgstr "Η συσκευή boot πρέπει να είναι η πρώτη συσ msgid "Both RX and TX required for flow control" msgstr "Και RX και TX απαιτούνται για έλεγχο flow" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Και τα δύο pin πρέπει να υποστηρίζουν interrupts υλικού" @@ -663,6 +670,11 @@ msgstr "Τα Buffers πρέπει να είναι του ιδίου μεγέθο msgid "Bus pin %d is already in use" msgstr "Bus pin %d είναι ήδη σε χρήση" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer πρέπει να είναι 16 bytes." @@ -2002,18 +2014,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2074,7 +2106,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2372,10 +2404,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - #: py/objtype.c msgid "__init__() should return None" msgstr "" @@ -3842,48 +3870,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 6be6e327f5..7b111a211a 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -595,6 +595,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "Both RX and TX required for flow control" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Both pins must support hardware interrupts" @@ -660,6 +667,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "Bus pin %d is already in use" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer must be 16 bytes." @@ -1999,6 +2011,10 @@ msgstr "System entry must be gnss.SatelliteSystem" msgid "Temperature read timed out" msgstr "Temperature read timed out" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -2007,6 +2023,14 @@ msgstr "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " @@ -2015,6 +2039,14 @@ msgstr "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "The length of rgb_pins must be 6, 12, 18, 24, or 30" @@ -2078,8 +2110,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "Timeout is too long: Maximum timeout length is %d seconds" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2379,10 +2411,6 @@ msgid "" msgstr "" "You pressed the reset button during boot. Press again to exit safe mode." -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "You requested starting safe mode by " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init__() should return None" @@ -3852,48 +3880,6 @@ msgstr "pow() 3rd argument cannot be 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() with 3 arguments requires integers" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "pressing boot button at start up.\n" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "pressing both buttons at start up.\n" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "pressing the left button at start up\n" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "pull masks conflict with direction masks" @@ -4414,6 +4400,21 @@ 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 "To exit, please reset the board without " +#~ msgstr "To exit, please reset the board without " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "You requested starting safe mode by " + +#~ msgid "pressing boot button at start up.\n" +#~ msgstr "pressing boot button at start up.\n" + +#~ msgid "pressing both buttons at start up.\n" +#~ msgstr "pressing both buttons at start up.\n" + +#~ msgid "pressing the left button at start up\n" +#~ msgstr "pressing the left button at start up\n" + #~ msgid "Only one TouchAlarm can be set in deep sleep." #~ msgstr "Only one TouchAlarm can be set in deep sleep." diff --git a/locale/es.po b/locale/es.po index 0251226112..5f3837732f 100644 --- a/locale/es.po +++ b/locale/es.po @@ -599,6 +599,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "Ambos RX y TX requeridos para control de flujo" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ambos pines deben soportar interrupciones por hardware" @@ -665,6 +672,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "Bus pin %d ya está siendo utilizado" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Búfer Byte debe de ser 16 bytes." @@ -2028,6 +2040,10 @@ msgstr "La entrada del sistema debe ser gnss.SatelliteSystem" msgid "Temperature read timed out" msgstr "Lectura de temperatura expirada" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -2036,6 +2052,14 @@ msgstr "" "El montículo de CircuitPython está corrupto porque la pila era muy pequeña.\n" "Aumente el tamaño de pila si sabe como. De lo contrario:" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " @@ -2044,6 +2068,14 @@ msgstr "" "El módulo de `microcontroller` se usó para un arranque en modo seguro. " "Presione reset para salir del modo seguro." +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "La longitud de rgb_pins debe ser 6, 12, 18, 24, o 30" @@ -2110,8 +2142,8 @@ msgstr "" "segundos" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Para salir, por favor reinicia la tarjeta sin " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2415,10 +2447,6 @@ msgstr "" "Has presionado el botón de reset durante el arranque. Presiones de nuevo " "para salir del modo seguro." -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Solicitaste iniciar en modo seguro por " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init__() deberia devolver None" @@ -3899,48 +3927,6 @@ msgstr "el 3er argumento de pow() no puede ser 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argumentos requiere enteros" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "presionando botón de arranque al inicio.\n" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "presionando ambos botones al inicio.\n" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "presione el botón izquierdo al arranque\n" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "máscara de pull en conflicto con máscara de dirección" @@ -4462,6 +4448,21 @@ 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 "To exit, please reset the board without " +#~ msgstr "Para salir, por favor reinicia la tarjeta sin " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Solicitaste iniciar en modo seguro por " + +#~ msgid "pressing boot button at start up.\n" +#~ msgstr "presionando botón de arranque al inicio.\n" + +#~ msgid "pressing both buttons at start up.\n" +#~ msgstr "presionando ambos botones al inicio.\n" + +#~ msgid "pressing the left button at start up\n" +#~ msgstr "presione el botón izquierdo al arranque\n" + #~ msgid "Only one TouchAlarm can be set in deep sleep." #~ msgstr "Solamente una TouchAlarm puede ser configurada durante deep sleep." diff --git a/locale/fil.po b/locale/fil.po index 390ced89ac..9391a5f697 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -588,6 +588,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ang parehong mga pin ay dapat na sumusuporta sa hardware interrupts" @@ -653,6 +660,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "Ginagamit na ang DAC" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c #, fuzzy msgid "Byte buffer must be 16 bytes." @@ -1992,18 +2004,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2064,8 +2096,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Para lumabas, paki-reset ang board na wala ang " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2364,10 +2396,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Ikaw ang humiling sa safe mode sa pamamagitan ng " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init__() dapat magbalik na None" @@ -3852,48 +3880,6 @@ msgstr "pow() 3rd argument ay hindi maaring 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() na may 3 argumento kailangan ng integers" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" @@ -4416,6 +4402,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "To exit, please reset the board without " +#~ msgstr "Para lumabas, paki-reset ang board na wala ang " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Ikaw ang humiling sa safe mode sa pamamagitan ng " + #~ msgid "Stream missing readinto() or write() method." #~ msgstr "Stream kulang ng readinto() o write() method." diff --git a/locale/fr.po b/locale/fr.po index 302afa03ae..9eb7bba7bd 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -601,6 +601,13 @@ msgstr "L'appareil de démarrage doit être le premier (interface #0)." msgid "Both RX and TX required for flow control" msgstr "RX et TX requis pour le contrôle de flux" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Les deux broches doivent supporter les interruptions matérielles" @@ -666,6 +673,11 @@ msgstr "Les tampons doivent avoir la même taille" msgid "Bus pin %d is already in use" msgstr "La broche %d du bus est déjà utilisée" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Le tampon doit être de 16 octets." @@ -2048,6 +2060,10 @@ msgstr "L'entrée du système doit être gnss.SatelliteSystem" msgid "Temperature read timed out" msgstr "Délais de lecture de température dépassée" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -2056,6 +2072,14 @@ msgstr "" "La pile de CircuitPython est corrompue parce que la pile était trop petite.\n" "Augmentez la taille de la pile si vous savez comment. Sinon :" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " @@ -2064,6 +2088,14 @@ msgstr "" "Le module `microcontroller` a été utilisé pour démarrer en mode sûr. Pressez " "reset pour quitter le mode sûr." +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "La taille de rgb_pins doit être 6, 12, 18, 24 ou 30" @@ -2131,8 +2163,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "Le délai est trop long : le délai maximal est de %d secondes" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Pour quitter, SVP redémarrez la carte sans " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2446,10 +2478,6 @@ msgstr "" "Vous avez pressé le bouton reset pendant le démarrage. Pressez-le à nouveau " "pour sortir du mode sûr." -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Vous avez demandé à démarrer en mode sans-échec par " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init__() doit retourner None" @@ -3941,48 +3969,6 @@ msgstr "le 3e argument de pow() ne peut être 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() avec 3 arguments nécessite des entiers" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "presser le bouton BOOT au démarrage.\n" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "presser le bouton SW38 au démarrage.\n" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "presser le bouton VOLUME au démarrage.\n" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "bouton boot appuyé lors du démarrage.\n" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "les deux boutons appuyés lors du démarrage.\n" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "appuyer le bouton de gauche au démarage\n" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "masque pull est en conflit avec les masques de direction" @@ -4504,6 +4490,30 @@ 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 "To exit, please reset the board without " +#~ msgstr "Pour quitter, SVP redémarrez la carte sans " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Vous avez demandé à démarrer en mode sans-échec par " + +#~ msgid "pressing BOOT button at start up.\n" +#~ msgstr "presser le bouton BOOT au démarrage.\n" + +#~ msgid "pressing SW38 button at start up.\n" +#~ msgstr "presser le bouton SW38 au démarrage.\n" + +#~ msgid "pressing VOLUME button at start up.\n" +#~ msgstr "presser le bouton VOLUME au démarrage.\n" + +#~ msgid "pressing boot button at start up.\n" +#~ msgstr "bouton boot appuyé lors du démarrage.\n" + +#~ msgid "pressing both buttons at start up.\n" +#~ msgstr "les deux boutons appuyés lors du démarrage.\n" + +#~ msgid "pressing the left button at start up\n" +#~ msgstr "appuyer le bouton de gauche au démarage\n" + #~ msgid "Only one TouchAlarm can be set in deep sleep." #~ msgstr "Seulement une TouchAlarm peu être réglée en sommeil profond." diff --git a/locale/hi.po b/locale/hi.po index 78f93241b7..cde333382b 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -583,6 +583,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -648,6 +655,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "" @@ -1975,18 +1987,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2047,7 +2079,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2345,10 +2377,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - #: py/objtype.c msgid "__init__() should return None" msgstr "" @@ -3815,48 +3843,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index bdfd83f211..dc688a83a9 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -595,6 +595,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "Sia RX che TX richiedono il controllo del flow" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Entrambi i pin devono supportare gli interrupt hardware" @@ -660,6 +667,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "Bus pin %d è già in uso" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "I buffer byte devono essere di almeno 16 bytes." @@ -2002,18 +2014,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2074,8 +2106,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Per uscire resettare la scheda senza " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2374,10 +2406,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "È stato richiesto l'avvio in modalità sicura da " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init__() deve ritornare None" @@ -3865,48 +3893,6 @@ msgstr "il terzo argomento di pow() non può essere 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argomenti richiede interi" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" @@ -4429,6 +4415,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "To exit, please reset the board without " +#~ msgstr "Per uscire resettare la scheda senza " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "È stato richiesto l'avvio in modalità sicura da " + #~ msgid "Stream missing readinto() or write() method." #~ msgstr "Metodi mancanti readinto() o write() allo stream." diff --git a/locale/ja.po b/locale/ja.po index 1b66c38ea9..3d3b5ef16c 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -590,6 +590,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "フロー制御のためRXとTXの両方が必要" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "両方のピンにハードウェア割り込み対応が必要" @@ -655,6 +662,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "Busピン%dはすでに使用中" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "バッファは16バイトでなければなりません" @@ -1988,18 +2000,38 @@ msgstr "system引数はgnss.SatelliteSystemでなければなりません" msgid "Temperature read timed out" msgstr "温度読み取りがタイムアウトしました" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2060,7 +2092,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "タイムアウトが長すぎです。最大のタイムアウト長は%d秒" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2359,10 +2391,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - #: py/objtype.c msgid "__init__() should return None" msgstr "" @@ -3836,48 +3864,6 @@ msgstr "pow()の3つ目の引数は0にできません" msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 9bca1c348b..88c8b4d3c6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -586,6 +586,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -651,6 +658,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "잘못된 크기의 버퍼. 16 바이트 여야합니다." @@ -1978,18 +1990,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2050,7 +2082,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2349,10 +2381,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - #: py/objtype.c msgid "__init__() should return None" msgstr "" @@ -3819,48 +3847,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 9c39c1a68a..69747fb971 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -588,6 +588,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "RX en TX zijn beide vereist voor stroomregeling" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Beide pinnen moeten hardware interrupts ondersteunen" @@ -653,6 +660,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "Bus pin %d al in gebruik" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer moet 16 bytes zijn." @@ -1999,18 +2011,38 @@ msgstr "Systeem invoer moet gnss.SatelliteSystem zijn" msgid "Temperature read timed out" msgstr "Temperatuur lees time-out" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "De lengte van rgb_pins moet 6, 12, 18, 24 of 30 zijn" @@ -2071,8 +2103,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Om te beëindigen, reset het bord zonder " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2375,10 +2407,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Je hebt aangeven de veilige modus te starten door " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init __() zou None moeten retourneren" @@ -3852,48 +3880,6 @@ msgstr "derde argument van pow() mag geen 0 zijn" msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "druk bootknop in bij opstarten.\n" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "druk beide knoppen in bij opstarten.\n" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" @@ -4414,6 +4400,18 @@ 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 "To exit, please reset the board without " +#~ msgstr "Om te beëindigen, reset het bord zonder " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Je hebt aangeven de veilige modus te starten door " + +#~ msgid "pressing boot button at start up.\n" +#~ msgstr "druk bootknop in bij opstarten.\n" + +#~ msgid "pressing both buttons at start up.\n" +#~ msgstr "druk beide knoppen in bij opstarten.\n" + #~ msgid "Firmware image is invalid" #~ msgstr "Firmware image is ongeldig" diff --git a/locale/pl.po b/locale/pl.po index dd91cd66fd..200a3eda99 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -590,6 +590,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "Do kontroli przepływu wymagane są zarówno RX, jak i TX" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Obie nóżki muszą wspierać przerwania sprzętowe" @@ -655,6 +662,11 @@ msgstr "" msgid "Bus pin %d is already in use" msgstr "Nóżka magistrali %d jest w użyciu" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Bufor musi mieć 16 bajtów." @@ -1986,18 +1998,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2058,8 +2090,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "By wyjść, proszę zresetować płytkę bez " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2356,10 +2388,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Zażądano trybu bezpieczeństwa przez " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init__() powinien zwracać None" @@ -3828,48 +3856,6 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" @@ -4390,6 +4376,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "To exit, please reset the board without " +#~ msgstr "By wyjść, proszę zresetować płytkę bez " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Zażądano trybu bezpieczeństwa przez " + #~ msgid "Stream missing readinto() or write() method." #~ msgstr "Strumień nie ma metod readinto() lub write()." diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3f50364a68..9aea2605f2 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -603,6 +603,13 @@ msgstr "" msgid "Both RX and TX required for flow control" msgstr "Ambos os RX e TX são necessários para o controle do fluxo" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ambos os pinos devem suportar interrupções de hardware" @@ -668,6 +675,11 @@ msgstr "Os buffers devem ter o mesmo tamanho" msgid "Bus pin %d is already in use" msgstr "O pino bus %d já está em uso" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "O buffer deve ter 16 bytes." @@ -2031,6 +2043,10 @@ msgstr "A entrada no sistema deve ser gnss.SatelliteSystem" msgid "Temperature read timed out" msgstr "A leitura da temperatura expirou" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -2040,6 +2056,14 @@ msgstr "" "corrompido pois a pilha era muito pequena.\n" "Aumente o tamanho da pilha se souber como. Senão:" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " @@ -2048,6 +2072,14 @@ msgstr "" "O módulo `microcontrolador` foi utilizado para iniciar em modo seguro. " "Pressione reset para encerrar do modo de segurança." +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "O comprimento dos rgb_pins devem ser 6, 12, 18, 24, ou 30" @@ -2116,8 +2148,8 @@ msgstr "" "segundos" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Para sair, por favor, reinicie a placa sem " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2428,10 +2460,6 @@ msgstr "" "Você pressionou o botão reset durante a inicialização. Pressione-o novamente " "para sair do modo de segurança." -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Você solicitou o início do modo de segurança através do " - #: py/objtype.c msgid "__init__() should return None" msgstr "O __init__() deve retornar Nenhum" @@ -3920,48 +3948,6 @@ msgstr "O terceiro argumento pow() não pode ser 0" msgid "pow() with 3 arguments requires integers" msgstr "o pow() com 3 argumentos requer números inteiros" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "pressionando o botão BOOT na inicialização.\n" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "pressionando o botão SW38 na inicialização.\n" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "pressionando o botão VOLUME na inicialização.\n" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "pressionando o botão de boot na inicialização.\n" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "pressionando ambos os botões durante a inicialização.\n" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "pressionando o botão central na inicialização.\n" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "pressionando o botão A na inicialização.\n" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "pressionando o botão esquerdo durante a inicialização\n" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "puxe as máscaras em conflito com as máscaras de direção" @@ -4482,6 +4468,36 @@ 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 "To exit, please reset the board without " +#~ msgstr "Para sair, por favor, reinicie a placa sem " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Você solicitou o início do modo de segurança através do " + +#~ msgid "pressing BOOT button at start up.\n" +#~ msgstr "pressionando o botão BOOT na inicialização.\n" + +#~ msgid "pressing SW38 button at start up.\n" +#~ msgstr "pressionando o botão SW38 na inicialização.\n" + +#~ msgid "pressing VOLUME button at start up.\n" +#~ msgstr "pressionando o botão VOLUME na inicialização.\n" + +#~ msgid "pressing boot button at start up.\n" +#~ msgstr "pressionando o botão de boot na inicialização.\n" + +#~ msgid "pressing both buttons at start up.\n" +#~ msgstr "pressionando ambos os botões durante a inicialização.\n" + +#~ msgid "pressing central button at start up.\n" +#~ msgstr "pressionando o botão central na inicialização.\n" + +#~ msgid "pressing button A at start up.\n" +#~ msgstr "pressionando o botão A na inicialização.\n" + +#~ msgid "pressing the left button at start up\n" +#~ msgstr "pressionando o botão esquerdo durante a inicialização\n" + #~ msgid "Only one TouchAlarm can be set in deep sleep." #~ msgstr "Apenas um TouchAlarm pode ser colocado em deep sleep." diff --git a/locale/ru.po b/locale/ru.po index 8a3dcef040..cb9f3616ec 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -597,6 +597,13 @@ msgstr "Загрузочное устройство должно быть пер msgid "Both RX and TX required for flow control" msgstr "Для управления потоком требуется как RX, так и TX" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Оба пина должны поддерживать аппаратные прерывания" @@ -662,6 +669,11 @@ msgstr "Буферы должны быть одинакового размера msgid "Bus pin %d is already in use" msgstr "Пин шины %d уже используется" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Буфер байтов должен быть размером 16 байтам." @@ -2022,18 +2034,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "Длина rgb_pins должна быть 6, 12, 18, 24 или 30" @@ -2096,7 +2128,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2394,10 +2426,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - #: py/objtype.c msgid "__init__() should return None" msgstr "" @@ -3864,48 +3892,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index ae47e52f1f..b1737876f1 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -595,6 +595,13 @@ msgstr "Startenheten måste vara den första enheten (gränssnitt #0)." msgid "Both RX and TX required for flow control" msgstr "Både RX och TX krävs för handskakning" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Båda pinnarna måste stödja maskinvaruavbrott" @@ -660,6 +667,11 @@ msgstr "Buffertarna måste ha samma storlek" msgid "Bus pin %d is already in use" msgstr "Busspinne %d används redan" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Byte-buffert måste vara 16 byte." @@ -2010,6 +2022,10 @@ msgstr "Systeminträdet måste vara gnss. SatellitSystem" msgid "Temperature read timed out" msgstr "Temperaturavläsning tog för lång tid" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -2018,6 +2034,14 @@ msgstr "" "CircuitPython-heapen blev korrupt eftersom stacken är för liten.\n" "Öka stackstorleken om du vet hur, eller om inte:" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " @@ -2026,6 +2050,14 @@ msgstr "" "Modulen `microcontroller` användes för att starta upp i felsäkert läge. " "Tryck på reset för att avsluta felsäkert läget." +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "Längden på rgb_pins vara 6, 12, 18, 24 eller 30" @@ -2092,8 +2124,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "Åtgärden tog för lång tid: Max väntetid är %d sekunder" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "För att avsluta, gör reset på kortet utan " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2400,10 +2432,6 @@ msgstr "" "Du tryckte på resetknappen under uppstarten. Tryck igen för att avsluta " "felsäkert läge." -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Du begärt att starta i felsäkert läge genom att " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init __() ska returnera None" @@ -3881,48 +3909,6 @@ msgstr "pow() 3: e argument kan inte vara 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() med 3 argument kräver heltal" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "genom att trycka på BOOT-knappen vid start.\n" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "genom att trycka på SW38-knappen vid start.\n" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "genom att trycka på VOLUME-knappen vid start.\n" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "genom att trycka på startknappen vid start.\n" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "genom att trycka båda knapparna vid uppstart.\n" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "trycka på mittknappen vid start.\n" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "genom att tryck på knappen A vid start.\n" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "genom att håll ner vänster knapp vid start\n" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "pull-mask är i konflikt med riktnings-mask" @@ -4443,6 +4429,36 @@ 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 "To exit, please reset the board without " +#~ msgstr "För att avsluta, gör reset på kortet utan " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Du begärt att starta i felsäkert läge genom att " + +#~ msgid "pressing BOOT button at start up.\n" +#~ msgstr "genom att trycka på BOOT-knappen vid start.\n" + +#~ msgid "pressing SW38 button at start up.\n" +#~ msgstr "genom att trycka på SW38-knappen vid start.\n" + +#~ msgid "pressing VOLUME button at start up.\n" +#~ msgstr "genom att trycka på VOLUME-knappen vid start.\n" + +#~ msgid "pressing boot button at start up.\n" +#~ msgstr "genom att trycka på startknappen vid start.\n" + +#~ msgid "pressing both buttons at start up.\n" +#~ msgstr "genom att trycka båda knapparna vid uppstart.\n" + +#~ msgid "pressing central button at start up.\n" +#~ msgstr "trycka på mittknappen vid start.\n" + +#~ msgid "pressing button A at start up.\n" +#~ msgstr "genom att tryck på knappen A vid start.\n" + +#~ msgid "pressing the left button at start up\n" +#~ msgstr "genom att håll ner vänster knapp vid start\n" + #~ msgid "Only one TouchAlarm can be set in deep sleep." #~ msgstr "Endast ett TouchAlarm kan ställas in för djupsömn." diff --git a/locale/tr.po b/locale/tr.po index ee72e1b336..ae8844521d 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -599,6 +599,13 @@ msgstr "Önyükleme cihazı ilk cihaz olmalı (arayüz #0)." msgid "Both RX and TX required for flow control" msgstr "Hem RX hem de TX akış kontrolü için gerekli" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -664,6 +671,11 @@ msgstr "Arabellek boyutları aynı olmalı" msgid "Bus pin %d is already in use" msgstr "Veriyolu pini %d kullanımda" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Bit buffer'ı 16bit olmalı." @@ -1995,18 +2007,38 @@ msgstr "" msgid "Temperature read timed out" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "" @@ -2067,7 +2099,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " +msgid "To exit, please reset the board without requesting safe mode." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2365,10 +2397,6 @@ msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "" - #: py/objtype.c msgid "__init__() should return None" msgstr "" @@ -3835,48 +3863,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b713d93d40..6cf446c792 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -596,6 +596,13 @@ msgstr "yǐndǎo shèbèi bìxū shì dìyī tái shèbèi (interface #0)." msgid "Both RX and TX required for flow control" msgstr "RX hé TX dōu xū yào liúliàng kòngzhì" +#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h +msgid "Both buttons were pressed at start up.\n" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "liǎnggè yǐnjiǎo dōu bìxū zhīchí yìngjiàn zhōngduàn" @@ -661,6 +668,11 @@ msgstr "huǎnchōng qū bìxū dàxiǎo xiāngtóng" msgid "Bus pin %d is already in use" msgstr "Zǒngxiàn yǐnjiǎo %d yǐjīng zài shǐyòng zhōng" +#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h +#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h +msgid "Button A was pressed at start up.\n" +msgstr "" + #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "Zìjié huǎnchōng qū bìxū shì 16 zìjié." @@ -2014,6 +2026,10 @@ msgstr "Xìtǒng tiáomù bìxū shì gnss.SatelliteSystem" msgid "Temperature read timed out" msgstr "Wēndù dòu qǔ chāoshí" +#: supervisor/shared/safe_mode.c +msgid "The BOOT button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -2022,6 +2038,14 @@ msgstr "" "diàn lù dàn duī bèi sǔn huài, yīn wéi duī zhàn tài xiǎo.\n" "rú guǒ nín zhī dào rú hé zēng jiā duī zhàn dà xiǎo. rú guǒ méi yǒu:" +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "The SW38 button was pressed at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "The VOLUME button was pressed at start up.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " @@ -2030,6 +2054,14 @@ msgstr "" "`wēi kòng zhì qì` mó kuài yòng yú qǐ dòng dào ān quán mó shì. àn chóng zhì " "tuì chū ān quán mó shì." +#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h +msgid "The central button was pressed at start up.\n" +msgstr "" + +#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +msgid "The left button was pressed at start up.\n" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "Rgb_pins de chángdù bìxū wèi 6,12,18,24 huò 30" @@ -2095,8 +2127,8 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "Chāoshí shíjiān tài zhǎng: Zuìdà chāoshí shíjiān wèi%d miǎo" #: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " +msgid "To exit, please reset the board without requesting safe mode." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2403,10 +2435,6 @@ msgstr "" "zài qǐ dòng guò chéng zhōng, nín àn xià le chóng zhì àn niǔ. zài cì àn xià " "yǐ tuì chū ān quán mó shì." -#: supervisor/shared/safe_mode.c -msgid "You requested starting safe mode by " -msgstr "Nín qǐngqiú qǐdòng ānquán móshì " - #: py/objtype.c msgid "__init__() should return None" msgstr "__init__() fǎnhuí not" @@ -3880,48 +3908,6 @@ msgstr "pow() 3 cān shǔ bùnéng wéi 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" -#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h -msgid "pressing BOOT button at start up.\n" -msgstr "zài qǐdòng shí àn BOOT ànniǔ.\n" - -#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h -msgid "pressing SW38 button at start up.\n" -msgstr "zài qǐdòng shí àn SW38 ànniǔ.\n" - -#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h -msgid "pressing VOLUME button at start up.\n" -msgstr "zài qǐdòng shí àn SW38 ànniǔ.\n" - -#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h -#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: supervisor/shared/safe_mode.c -msgid "pressing boot button at start up.\n" -msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" - -#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h -#: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h -#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h -#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h -msgid "pressing both buttons at start up.\n" -msgstr "zài qǐdòng shí tóngshí àn xià liǎng gè ànniǔ.\n" - -#: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h -msgid "pressing central button at start up.\n" -msgstr "" - -#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h -#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h -msgid "pressing button A at start up.\n" -msgstr "" - -#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h -msgid "pressing the left button at start up\n" -msgstr "qǐ dòng shí àn xià zuǒ àn niǔ\n" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "lā kǒu zhào yǔ fāng xiàng miàn mó chōng tū" @@ -4445,6 +4431,30 @@ 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 "To exit, please reset the board without " +#~ msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " + +#~ msgid "You requested starting safe mode by " +#~ msgstr "Nín qǐngqiú qǐdòng ānquán móshì " + +#~ msgid "pressing BOOT button at start up.\n" +#~ msgstr "zài qǐdòng shí àn BOOT ànniǔ.\n" + +#~ msgid "pressing SW38 button at start up.\n" +#~ msgstr "zài qǐdòng shí àn SW38 ànniǔ.\n" + +#~ msgid "pressing VOLUME button at start up.\n" +#~ msgstr "zài qǐdòng shí àn SW38 ànniǔ.\n" + +#~ msgid "pressing boot button at start up.\n" +#~ msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" + +#~ msgid "pressing both buttons at start up.\n" +#~ msgstr "zài qǐdòng shí tóngshí àn xià liǎng gè ànniǔ.\n" + +#~ msgid "pressing the left button at start up\n" +#~ msgstr "qǐ dòng shí àn xià zuǒ àn niǔ\n" + #~ msgid "Only one TouchAlarm can be set in deep sleep." #~ msgstr "zhǐ yǒu yí gè chù mō bì kě yǐ shè zhì zài shēn dù shuì mián." From 468709abcc4960bd69c6b2dc86fa9ac07fb3d92a Mon Sep 17 00:00:00 2001 From: dronecz Date: Sun, 30 Oct 2022 18:51:46 +0100 Subject: [PATCH 028/357] Update pins.c Hopefully last change nefore merge. --- ports/espressif/boards/maker_badge/pins.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ports/espressif/boards/maker_badge/pins.c b/ports/espressif/boards/maker_badge/pins.c index abecb7fef3..f97eed60d5 100644 --- a/ports/espressif/boards/maker_badge/pins.c +++ b/ports/espressif/boards/maker_badge/pins.c @@ -7,7 +7,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_CAP5), MP_ROM_PTR(&pin_GPIO1) }, - + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_CAP4), MP_ROM_PTR(&pin_GPIO2) }, @@ -19,19 +19,19 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_CAP1), MP_ROM_PTR(&pin_GPIO5) }, - + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, - + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, - + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, - + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, @@ -58,7 +58,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, { 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) }, @@ -73,11 +73,11 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, { 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_D42), MP_ROM_PTR(&pin_GPIO42) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, From 01ea436b5cf9d2c000bbc41bc704aa7c3ea96d1b Mon Sep 17 00:00:00 2001 From: test Date: Sun, 30 Oct 2022 21:16:36 +0000 Subject: [PATCH 029/357] Add translate file --- locale/circuitpython.pot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 768daa8651..ac6dd92211 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -3843,6 +3843,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/espressif/boards/maker_badge/mpconfigboard.h +msgid "pressing boot button at start up.\n" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" From 5a2d1ef49f6d4b8f69af8e959d82efecbd0cd228 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sun, 30 Oct 2022 12:27:19 +0000 Subject: [PATCH 030/357] Translated using Weblate (Swedish) Currently translated at 100.0% (1003 of 1003 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index b1737876f1..598843479c 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-10-29 22:00+0000\n" +"PO-Revision-Date: 2022-10-31 13:02+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -600,7 +600,7 @@ msgstr "Både RX och TX krävs för handskakning" #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "Both buttons were pressed at start up.\n" -msgstr "" +msgstr "Båda knapparna trycktes ned vid start.\n" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -670,7 +670,7 @@ msgstr "Busspinne %d används redan" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "Button A was pressed at start up.\n" -msgstr "" +msgstr "Knapp A trycktes ned vid start.\n" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -2024,7 +2024,7 @@ msgstr "Temperaturavläsning tog för lång tid" #: supervisor/shared/safe_mode.c msgid "The BOOT button was pressed at start up.\n" -msgstr "" +msgstr "BOOT-knappen trycktes ner vid start.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2036,11 +2036,11 @@ msgstr "" #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "The SW38 button was pressed at start up.\n" -msgstr "" +msgstr "SW38-knappen trycktes ned vid start.\n" #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "The VOLUME button was pressed at start up.\n" -msgstr "" +msgstr "VOLUME-knappen trycktes ned vid start.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2052,11 +2052,11 @@ msgstr "" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" -msgstr "" +msgstr "Mittknappen trycktes in vid start.\n" #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "The left button was pressed at start up.\n" -msgstr "" +msgstr "Den vänstra knappen trycktes ned vid start.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" @@ -2125,7 +2125,7 @@ msgstr "Åtgärden tog för lång tid: Max väntetid är %d sekunder" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without requesting safe mode." -msgstr "" +msgstr "För att avsluta, återställ kortet utan att begära säkert läge." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" From 3601bd1fb35d71215e350e2aa8750625245b872e Mon Sep 17 00:00:00 2001 From: dronecz Date: Mon, 31 Oct 2022 21:38:54 +0100 Subject: [PATCH 031/357] Delete frozen/Adafruit_CircuitPython_SSD1680 directory --- .../adafruit_circuitpython_pr.md | 13 - .../.github/workflows/build.yml | 77 ---- .../.github/workflows/failure-help-text.yml | 19 - .../.github/workflows/release.yml | 88 ---- .../Adafruit_CircuitPython_SSD1680/.gitignore | 47 -- .../.pre-commit-config.yaml | 42 -- .../Adafruit_CircuitPython_SSD1680/.pylintrc | 436 ------------------ .../.readthedocs.yaml | 19 - .../CODE_OF_CONDUCT.md | 137 ------ frozen/Adafruit_CircuitPython_SSD1680/LICENSE | 21 - .../LICENSES/CC-BY-4.0.txt | 324 ------------- .../LICENSES/MIT.txt | 19 - .../LICENSES/Unlicense.txt | 20 - .../Adafruit_CircuitPython_SSD1680/README.rst | 138 ------ .../README.rst.license | 3 - .../adafruit_ssd1680.py | 100 ---- .../docs/_static/favicon.ico | Bin 4414 -> 0 bytes .../docs/_static/favicon.ico.license | 3 - .../docs/api.rst | 8 - .../docs/api.rst.license | 4 - .../docs/conf.py | 194 -------- .../docs/examples.rst | 8 - .../docs/examples.rst.license | 4 - .../docs/index.rst | 50 -- .../docs/index.rst.license | 4 - .../docs/requirements.txt | 5 - .../examples/display-ruler.bmp | Bin 360122 -> 0 bytes .../examples/display-ruler.bmp.license | 2 - .../examples/ssd1680_simpletest.py | 60 --- .../optional_requirements.txt | 3 - .../pyproject.toml | 47 -- .../requirements.txt | 5 - 32 files changed, 1900 deletions(-) delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/build.yml delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/failure-help-text.yml delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/release.yml delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.gitignore delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.pre-commit-config.yaml delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.pylintrc delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/.readthedocs.yaml delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/CODE_OF_CONDUCT.md delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/LICENSE delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/LICENSES/CC-BY-4.0.txt delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/LICENSES/MIT.txt delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/LICENSES/Unlicense.txt delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/README.rst delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/README.rst.license delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/adafruit_ssd1680.py delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/_static/favicon.ico delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/_static/favicon.ico.license delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/api.rst delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/api.rst.license delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/conf.py delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/examples.rst delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/examples.rst.license delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst.license delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/docs/requirements.txt delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp.license delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/examples/ssd1680_simpletest.py delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/optional_requirements.txt delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/pyproject.toml delete mode 100644 frozen/Adafruit_CircuitPython_SSD1680/requirements.txt diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md b/frozen/Adafruit_CircuitPython_SSD1680/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md deleted file mode 100644 index 8de294e68a..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Adafruit Industries -# -# SPDX-License-Identifier: MIT - -Thank you for contributing! Before you submit a pull request, please read the following. - -Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html - -If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs - -Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code - -Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/build.yml b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/build.yml deleted file mode 100644 index cb2f60e36a..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/build.yml +++ /dev/null @@ -1,77 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -name: Build CI - -on: [pull_request, push] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Translate Repo Name For Build Tools filename_prefix - id: repo-name - run: | - echo ::set-output name=repo-name::$( - echo ${{ github.repository }} | - awk -F '\/' '{ print tolower($2) }' | - tr '_' '-' - ) - - name: Set up Python 3.x - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Versions - run: | - python3 --version - - name: Checkout Current Repo - uses: actions/checkout@v1 - with: - submodules: true - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: adafruit/actions-ci-circuitpython-libs - path: actions-ci - - name: Install dependencies - # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.) - run: | - source actions-ci/install.sh - - name: Pip install Sphinx, pre-commit - run: | - pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit - - name: Library version - run: git describe --dirty --always --tags - - name: Setup problem matchers - uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 - - name: Pre-commit hooks - run: | - pre-commit run --all-files - - name: Build assets - run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . - - name: Archive bundles - uses: actions/upload-artifact@v2 - with: - name: bundles - path: ${{ github.workspace }}/bundles/ - - name: Build docs - working-directory: docs - run: sphinx-build -E -W -b html . _build/html - - name: Check For pyproject.toml - id: need-pypi - run: | - echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) - - name: Build Python package - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - run: | - pip install --upgrade build twine - for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0+auto.0/1.2.3/" $file; - done; - python -m build - twine check dist/* diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/failure-help-text.yml b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/failure-help-text.yml deleted file mode 100644 index 0b1194f0cd..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/failure-help-text.yml +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -name: Failure help text - -on: - workflow_run: - workflows: ["Build CI"] - types: - - completed - -jobs: - post-help: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }} - steps: - - name: Post comment to help - uses: adafruit/circuitpython-action-library-ci-failed@v1 diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/release.yml b/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/release.yml deleted file mode 100644 index f3a0325ba3..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/.github/workflows/release.yml +++ /dev/null @@ -1,88 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -name: Release Actions - -on: - release: - types: [published] - -jobs: - upload-release-assets: - runs-on: ubuntu-latest - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Translate Repo Name For Build Tools filename_prefix - id: repo-name - run: | - echo ::set-output name=repo-name::$( - echo ${{ github.repository }} | - awk -F '\/' '{ print tolower($2) }' | - tr '_' '-' - ) - - name: Set up Python 3.x - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Versions - run: | - python3 --version - - name: Checkout Current Repo - uses: actions/checkout@v1 - with: - submodules: true - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: adafruit/actions-ci-circuitpython-libs - path: actions-ci - - name: Install deps - run: | - source actions-ci/install.sh - - name: Build assets - run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . - - name: Upload Release Assets - # the 'official' actions version does not yet support dynamically - # supplying asset names to upload. @csexton's version chosen based on - # discussion in the issue below, as its the simplest to implement and - # allows for selecting files with a pattern. - # https://github.com/actions/upload-release-asset/issues/4 - #uses: actions/upload-release-asset@v1.0.1 - uses: csexton/release-asset-action@master - with: - pattern: "bundles/*" - github-token: ${{ secrets.GITHUB_TOKEN }} - - upload-pypi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Check For pyproject.toml - id: need-pypi - run: | - echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) - - name: Set up Python - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - run: | - python -m pip install --upgrade pip - pip install --upgrade build twine - - name: Build and publish - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - env: - TWINE_USERNAME: ${{ secrets.pypi_username }} - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: | - for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file; - done; - python -m build - twine upload dist/* diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.gitignore b/frozen/Adafruit_CircuitPython_SSD1680/.gitignore deleted file mode 100644 index 544ec4a695..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/.gitignore +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -# Do not include files and directories created by your personal work environment, such as the IDE -# you use, except for those already listed here. Pull requests including changes to this file will -# not be accepted. - -# This .gitignore file contains rules for files generated by working with CircuitPython libraries, -# including building Sphinx, testing with pip, and creating a virual environment, as well as the -# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs. - -# If you find that there are files being generated on your machine that should not be included in -# your git commit, you should create a .gitignore_global file on your computer to include the -# files created by your personal setup. To do so, follow the two steps below. - -# First, create a file called .gitignore_global somewhere convenient for you, and add rules for -# the files you want to exclude from git commits. - -# Second, configure Git to use the exclude file for all Git repositories by running the -# following via commandline, replacing "path/to/your/" with the actual path to your newly created -# .gitignore_global file: -# git config --global core.excludesfile path/to/your/.gitignore_global - -# CircuitPython-specific files -*.mpy - -# Python-specific files -__pycache__ -*.pyc - -# Sphinx build-specific files -_build - -# This file results from running `pip -e install .` in a local repository -*.egg-info - -# Virtual environment-specific files -.env - -# MacOS-specific files -*.DS_Store - -# IDE-specific files -.idea -.vscode -*~ diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.pre-commit-config.yaml b/frozen/Adafruit_CircuitPython_SSD1680/.pre-commit-config.yaml deleted file mode 100644 index 3343606412..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/.pre-commit-config.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò -# -# SPDX-License-Identifier: Unlicense - -repos: - - repo: https://github.com/python/black - rev: 22.3.0 - hooks: - - id: black - - repo: https://github.com/fsfe/reuse-tool - rev: v0.14.0 - hooks: - - id: reuse - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 - hooks: - - id: check-yaml - - id: end-of-file-fixer - - id: trailing-whitespace - - repo: https://github.com/pycqa/pylint - rev: v2.11.1 - hooks: - - id: pylint - name: pylint (library code) - types: [python] - args: - - --disable=consider-using-f-string - exclude: "^(docs/|examples/|tests/|setup.py$)" - - id: pylint - name: pylint (example code) - description: Run pylint rules on "examples/*.py" files - types: [python] - files: "^examples/" - args: - - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code - - id: pylint - name: pylint (test code) - description: Run pylint rules on "tests/*.py" files - types: [python] - files: "^tests/" - args: - - --disable=missing-docstring,consider-using-f-string,duplicate-code diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.pylintrc b/frozen/Adafruit_CircuitPython_SSD1680/.pylintrc deleted file mode 100644 index 1f42e5de32..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/.pylintrc +++ /dev/null @@ -1,436 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -[MASTER] - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code -extension-pkg-whitelist= - -# Add files or directories to the ignore-list. They should be base names, not -# paths. -ignore=CVS - -# Add files or directories matching the regex patterns to the ignore-list. The -# regex matches against base names, not paths. -ignore-patterns= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. -jobs=1 - -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins= - -# Pickle collected data for later comparisons. -persistent=yes - -# Specify a configuration file. -#rcfile= - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED -confidence= - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call -disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,pointless-string-statement,unspecified-encoding - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable= - - -[REPORTS] - -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details -#msg-template= - -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio).You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. -output-format=text - -# Tells whether to display a full report or only the messages -reports=no - -# Activate the evaluation score. -score=yes - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - - -[LOGGING] - -# Logging modules to check that the string format arguments are in logging -# function parameter format -logging-modules=logging - - -[SPELLING] - -# Spelling dictionary name. Available dictionaries: none. To make it working -# install python-enchant package. -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. -spelling-store-unknown-words=no - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -# notes=FIXME,XXX,TODO -notes=FIXME,XXX - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules=board - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_,_cb - -# A regular expression matching the name of dummy variables (i.e. expectedly -# not used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. Default to name -# with leading underscore -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,future.builtins - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -# expected-line-ending-format= -expected-line-ending-format=LF - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=100 - -# Maximum number of lines in a module -max-module-lines=1000 - -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=yes - -# Minimum lines number of a similarity. -min-similarity-lines=12 - - -[BASIC] - -# Naming hint for argument names -argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct argument names -argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Naming hint for attribute names -attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct attribute names -attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Bad variable names which should always be refused, separated by a comma -bad-names=foo,bar,baz,toto,tutu,tata - -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Regular expression matching correct class attribute names -class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Naming hint for class names -# class-name-hint=[A-Z_][a-zA-Z0-9]+$ -class-name-hint=[A-Z_][a-zA-Z0-9_]+$ - -# Regular expression matching correct class names -# class-rgx=[A-Z_][a-zA-Z0-9]+$ -class-rgx=[A-Z_][a-zA-Z0-9_]+$ - -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Regular expression matching correct constant names -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming hint for function names -function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct function names -function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Good variable names which should always be accepted, separated by a comma -# good-names=i,j,k,ex,Run,_ -good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_ - -# Include a hint for the correct naming format with invalid-name -include-naming-hint=no - -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ - -# Regular expression matching correct inline iteration names -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ - -# Naming hint for method names -method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct method names -method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Regular expression matching correct module names -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -property-classes=abc.abstractproperty - -# Naming hint for variable names -variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct variable names -variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - - -[IMPORTS] - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=optparse,tkinter.tix - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled) -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled) -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled) -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__,__new__,setUp - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict,_fields,_replace,_source,_make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[DESIGN] - -# Maximum number of arguments for function / method -max-args=5 - -# Maximum number of attributes for a class (see R0902). -# max-attributes=7 -max-attributes=11 - -# Maximum number of boolean expressions in a if statement -max-bool-expr=5 - -# Maximum number of branch for function / method body -max-branches=12 - -# Maximum number of locals for function / method body -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body -max-returns=6 - -# Maximum number of statements in function / method body -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=1 - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception diff --git a/frozen/Adafruit_CircuitPython_SSD1680/.readthedocs.yaml b/frozen/Adafruit_CircuitPython_SSD1680/.readthedocs.yaml deleted file mode 100644 index 33c2a6108e..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/.readthedocs.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -build: - os: ubuntu-20.04 - tools: - python: "3" - -python: - install: - - requirements: docs/requirements.txt - - requirements: requirements.txt diff --git a/frozen/Adafruit_CircuitPython_SSD1680/CODE_OF_CONDUCT.md b/frozen/Adafruit_CircuitPython_SSD1680/CODE_OF_CONDUCT.md deleted file mode 100644 index d885b3605a..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,137 +0,0 @@ - -# Adafruit Community Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and leaders pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level or type of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -We are committed to providing a friendly, safe and welcoming environment for -all. - -Examples of behavior that contributes to creating a positive environment -include: - -* Be kind and courteous to others -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Collaborating with other community members -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and sexual attention or advances -* The use of inappropriate images, including in a community member's avatar -* The use of inappropriate language, including in a community member's nickname -* Any spamming, flaming, baiting or other attention-stealing behavior -* Excessive or unwelcome helping; answering outside the scope of the question - asked -* Trolling, insulting/derogatory comments, and personal or political attacks -* Promoting or spreading disinformation, lies, or conspiracy theories against - a person, group, organisation, project, or community -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate - -The goal of the standards and moderation guidelines outlined here is to build -and maintain a respectful community. We ask that you don’t just aim to be -"technically unimpeachable", but rather try to be your best self. - -We value many things beyond technical expertise, including collaboration and -supporting others within our community. Providing a positive experience for -other community members can have a much more significant impact than simply -providing the correct answer. - -## Our Responsibilities - -Project leaders are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project leaders have the right and responsibility to remove, edit, or -reject messages, comments, commits, code, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any community member for other behaviors that they deem -inappropriate, threatening, offensive, or harmful. - -## Moderation - -Instances of behaviors that violate the Adafruit Community Code of Conduct -may be reported by any member of the community. Community members are -encouraged to report these situations, including situations they witness -involving other community members. - -You may report in the following ways: - -In any situation, you may send an email to . - -On the Adafruit Discord, you may send an open message from any channel -to all Community Moderators by tagging @community moderators. You may -also send an open message from any channel, or a direct message to -@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442, -@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175. - -Email and direct message reports will be kept confidential. - -In situations on Discord where the issue is particularly egregious, possibly -illegal, requires immediate action, or violates the Discord terms of service, -you should also report the message directly to Discord. - -These are the steps for upholding our community’s standards of conduct. - -1. Any member of the community may report any situation that violates the -Adafruit Community Code of Conduct. All reports will be reviewed and -investigated. -2. If the behavior is an egregious violation, the community member who -committed the violation may be banned immediately, without warning. -3. Otherwise, moderators will first respond to such behavior with a warning. -4. Moderators follow a soft "three strikes" policy - the community member may -be given another chance, if they are receptive to the warning and change their -behavior. -5. If the community member is unreceptive or unreasonable when warned by a -moderator, or the warning goes unheeded, they may be banned for a first or -second offense. Repeated offenses will result in the community member being -banned. - -## Scope - -This Code of Conduct and the enforcement policies listed above apply to all -Adafruit Community venues. This includes but is not limited to any community -spaces (both public and private), the entire Adafruit Discord server, and -Adafruit GitHub repositories. Examples of Adafruit Community spaces include -but are not limited to meet-ups, audio chats on the Adafruit Discord, or -interaction at a conference. - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. As a community -member, you are representing our community, and are expected to behave -accordingly. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant], -version 1.4, available at -, -and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). - -For other projects adopting the Adafruit Community Code of -Conduct, please contact the maintainers of those projects for enforcement. -If you wish to use this code of conduct for your own project, consider -explicitly mentioning your moderation policy or making a copy with your -own moderation policy so as to avoid confusion. - -[Contributor Covenant]: https://www.contributor-covenant.org diff --git a/frozen/Adafruit_CircuitPython_SSD1680/LICENSE b/frozen/Adafruit_CircuitPython_SSD1680/LICENSE deleted file mode 100644 index 88160406de..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2021 Melissa LeBlanc-Williams 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. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/CC-BY-4.0.txt b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/CC-BY-4.0.txt deleted file mode 100644 index 3f92dfc5fd..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/CC-BY-4.0.txt +++ /dev/null @@ -1,324 +0,0 @@ -Creative Commons Attribution 4.0 International Creative Commons Corporation -("Creative Commons") is not a law firm and does not provide legal services -or legal advice. Distribution of Creative Commons public licenses does not -create a lawyer-client or other relationship. Creative Commons makes its licenses -and related information available on an "as-is" basis. Creative Commons gives -no warranties regarding its licenses, any material licensed under their terms -and conditions, or any related information. Creative Commons disclaims all -liability for damages resulting from their use to the fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and conditions -that creators and other rights holders may use to share original works of -authorship and other material subject to copyright and certain other rights -specified in the public license below. The following considerations are for -informational purposes only, are not exhaustive, and do not form part of our -licenses. - -Considerations for licensors: Our public licenses are intended for use by -those authorized to give the public permission to use material in ways otherwise -restricted by copyright and certain other rights. Our licenses are irrevocable. -Licensors should read and understand the terms and conditions of the license -they choose before applying it. Licensors should also secure all rights necessary -before applying our licenses so that the public can reuse the material as -expected. Licensors should clearly mark any material not subject to the license. -This includes other CC-licensed material, or material used under an exception -or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors - -Considerations for the public: By using one of our public licenses, a licensor -grants the public permission to use the licensed material under specified -terms and conditions. If the licensor's permission is not necessary for any -reason–for example, because of any applicable exception or limitation to copyright–then -that use is not regulated by the license. Our licenses grant only permissions -under copyright and certain other rights that a licensor has authority to -grant. Use of the licensed material may still be restricted for other reasons, -including because others have copyright or other rights in the material. A -licensor may make special requests, such as asking that all changes be marked -or described. Although not required by our licenses, you are encouraged to -respect those requests where reasonable. More considerations for the public -: wiki.creativecommons.org/Considerations_for_licensees Creative Commons Attribution -4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree to -be bound by the terms and conditions of this Creative Commons Attribution -4.0 International Public License ("Public License"). To the extent this Public -License may be interpreted as a contract, You are granted the Licensed Rights -in consideration of Your acceptance of these terms and conditions, and the -Licensor grants You such rights in consideration of benefits the Licensor -receives from making the Licensed Material available under these terms and -conditions. - -Section 1 – Definitions. - -a. Adapted Material means material subject to Copyright and Similar Rights -that is derived from or based upon the Licensed Material and in which the -Licensed Material is translated, altered, arranged, transformed, or otherwise -modified in a manner requiring permission under the Copyright and Similar -Rights held by the Licensor. For purposes of this Public License, where the -Licensed Material is a musical work, performance, or sound recording, Adapted -Material is always produced where the Licensed Material is synched in timed -relation with a moving image. - -b. Adapter's License means the license You apply to Your Copyright and Similar -Rights in Your contributions to Adapted Material in accordance with the terms -and conditions of this Public License. - -c. Copyright and Similar Rights means copyright and/or similar rights closely -related to copyright including, without limitation, performance, broadcast, -sound recording, and Sui Generis Database Rights, without regard to how the -rights are labeled or categorized. For purposes of this Public License, the -rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. - -d. Effective Technological Measures means those measures that, in the absence -of proper authority, may not be circumvented under laws fulfilling obligations -under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, -and/or similar international agreements. - -e. Exceptions and Limitations means fair use, fair dealing, and/or any other -exception or limitation to Copyright and Similar Rights that applies to Your -use of the Licensed Material. - -f. Licensed Material means the artistic or literary work, database, or other -material to which the Licensor applied this Public License. - -g. Licensed Rights means the rights granted to You subject to the terms and -conditions of this Public License, which are limited to all Copyright and -Similar Rights that apply to Your use of the Licensed Material and that the -Licensor has authority to license. - -h. Licensor means the individual(s) or entity(ies) granting rights under this -Public License. - -i. Share means to provide material to the public by any means or process that -requires permission under the Licensed Rights, such as reproduction, public -display, public performance, distribution, dissemination, communication, or -importation, and to make material available to the public including in ways -that members of the public may access the material from a place and at a time -individually chosen by them. - -j. Sui Generis Database Rights means rights other than copyright resulting -from Directive 96/9/EC of the European Parliament and of the Council of 11 -March 1996 on the legal protection of databases, as amended and/or succeeded, -as well as other essentially equivalent rights anywhere in the world. - -k. You means the individual or entity exercising the Licensed Rights under -this Public License. Your has a corresponding meaning. - -Section 2 – Scope. - - a. License grant. - -1. Subject to the terms and conditions of this Public License, the Licensor -hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, -irrevocable license to exercise the Licensed Rights in the Licensed Material -to: - - A. reproduce and Share the Licensed Material, in whole or in part; and - - B. produce, reproduce, and Share Adapted Material. - -2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions -and Limitations apply to Your use, this Public License does not apply, and -You do not need to comply with its terms and conditions. - - 3. Term. The term of this Public License is specified in Section 6(a). - -4. Media and formats; technical modifications allowed. The Licensor authorizes -You to exercise the Licensed Rights in all media and formats whether now known -or hereafter created, and to make technical modifications necessary to do -so. The Licensor waives and/or agrees not to assert any right or authority -to forbid You from making technical modifications necessary to exercise the -Licensed Rights, including technical modifications necessary to circumvent -Effective Technological Measures. For purposes of this Public License, simply -making modifications authorized by this Section 2(a)(4) never produces Adapted -Material. - - 5. Downstream recipients. - -A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed -Material automatically receives an offer from the Licensor to exercise the -Licensed Rights under the terms and conditions of this Public License. - -B. No downstream restrictions. You may not offer or impose any additional -or different terms or conditions on, or apply any Effective Technological -Measures to, the Licensed Material if doing so restricts exercise of the Licensed -Rights by any recipient of the Licensed Material. - -6. No endorsement. Nothing in this Public License constitutes or may be construed -as permission to assert or imply that You are, or that Your use of the Licensed -Material is, connected with, or sponsored, endorsed, or granted official status -by, the Licensor or others designated to receive attribution as provided in -Section 3(a)(1)(A)(i). - - b. Other rights. - -1. Moral rights, such as the right of integrity, are not licensed under this -Public License, nor are publicity, privacy, and/or other similar personality -rights; however, to the extent possible, the Licensor waives and/or agrees -not to assert any such rights held by the Licensor to the limited extent necessary -to allow You to exercise the Licensed Rights, but not otherwise. - -2. Patent and trademark rights are not licensed under this Public License. - -3. To the extent possible, the Licensor waives any right to collect royalties -from You for the exercise of the Licensed Rights, whether directly or through -a collecting society under any voluntary or waivable statutory or compulsory -licensing scheme. In all other cases the Licensor expressly reserves any right -to collect such royalties. - -Section 3 – License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the following -conditions. - - a. Attribution. - -1. If You Share the Licensed Material (including in modified form), You must: - -A. retain the following if it is supplied by the Licensor with the Licensed -Material: - -i. identification of the creator(s) of the Licensed Material and any others -designated to receive attribution, in any reasonable manner requested by the -Licensor (including by pseudonym if designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of warranties; - -v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; - -B. indicate if You modified the Licensed Material and retain an indication -of any previous modifications; and - -C. indicate the Licensed Material is licensed under this Public License, and -include the text of, or the URI or hyperlink to, this Public License. - -2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner -based on the medium, means, and context in which You Share the Licensed Material. -For example, it may be reasonable to satisfy the conditions by providing a -URI or hyperlink to a resource that includes the required information. - -3. If requested by the Licensor, You must remove any of the information required -by Section 3(a)(1)(A) to the extent reasonably practicable. - -4. If You Share Adapted Material You produce, the Adapter's License You apply -must not prevent recipients of the Adapted Material from complying with this -Public License. - -Section 4 – Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that apply to -Your use of the Licensed Material: - -a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, -reuse, reproduce, and Share all or a substantial portion of the contents of -the database; - -b. if You include all or a substantial portion of the database contents in -a database in which You have Sui Generis Database Rights, then the database -in which You have Sui Generis Database Rights (but not its individual contents) -is Adapted Material; and - -c. You must comply with the conditions in Section 3(a) if You Share all or -a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not replace -Your obligations under this Public License where the Licensed Rights include -other Copyright and Similar Rights. - -Section 5 – Disclaimer of Warranties and Limitation of Liability. - -a. Unless otherwise separately undertaken by the Licensor, to the extent possible, -the Licensor offers the Licensed Material as-is and as-available, and makes -no representations or warranties of any kind concerning the Licensed Material, -whether express, implied, statutory, or other. This includes, without limitation, -warranties of title, merchantability, fitness for a particular purpose, non-infringement, -absence of latent or other defects, accuracy, or the presence or absence of -errors, whether or not known or discoverable. Where disclaimers of warranties -are not allowed in full or in part, this disclaimer may not apply to You. - -b. To the extent possible, in no event will the Licensor be liable to You -on any legal theory (including, without limitation, negligence) or otherwise -for any direct, special, indirect, incidental, consequential, punitive, exemplary, -or other losses, costs, expenses, or damages arising out of this Public License -or use of the Licensed Material, even if the Licensor has been advised of -the possibility of such losses, costs, expenses, or damages. Where a limitation -of liability is not allowed in full or in part, this limitation may not apply -to You. - -c. The disclaimer of warranties and limitation of liability provided above -shall be interpreted in a manner that, to the extent possible, most closely -approximates an absolute disclaimer and waiver of all liability. - -Section 6 – Term and Termination. - -a. This Public License applies for the term of the Copyright and Similar Rights -licensed here. However, if You fail to comply with this Public License, then -Your rights under this Public License terminate automatically. - -b. Where Your right to use the Licensed Material has terminated under Section -6(a), it reinstates: - -1. automatically as of the date the violation is cured, provided it is cured -within 30 days of Your discovery of the violation; or - - 2. upon express reinstatement by the Licensor. - -c. For the avoidance of doubt, this Section 6(b) does not affect any right -the Licensor may have to seek remedies for Your violations of this Public -License. - -d. For the avoidance of doubt, the Licensor may also offer the Licensed Material -under separate terms or conditions or stop distributing the Licensed Material -at any time; however, doing so will not terminate this Public License. - - e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. - -Section 7 – Other Terms and Conditions. - -a. The Licensor shall not be bound by any additional or different terms or -conditions communicated by You unless expressly agreed. - -b. Any arrangements, understandings, or agreements regarding the Licensed -Material not stated herein are separate from and independent of the terms -and conditions of this Public License. - -Section 8 – Interpretation. - -a. For the avoidance of doubt, this Public License does not, and shall not -be interpreted to, reduce, limit, restrict, or impose conditions on any use -of the Licensed Material that could lawfully be made without permission under -this Public License. - -b. To the extent possible, if any provision of this Public License is deemed -unenforceable, it shall be automatically reformed to the minimum extent necessary -to make it enforceable. If the provision cannot be reformed, it shall be severed -from this Public License without affecting the enforceability of the remaining -terms and conditions. - -c. No term or condition of this Public License will be waived and no failure -to comply consented to unless expressly agreed to by the Licensor. - -d. Nothing in this Public License constitutes or may be interpreted as a limitation -upon, or waiver of, any privileges and immunities that apply to the Licensor -or You, including from the legal processes of any jurisdiction or authority. - -Creative Commons is not a party to its public licenses. Notwithstanding, Creative -Commons may elect to apply one of its public licenses to material it publishes -and in those instances will be considered the "Licensor." The text of the -Creative Commons public licenses is dedicated to the public domain under the -CC0 Public Domain Dedication. Except for the limited purpose of indicating -that material is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at creativecommons.org/policies, -Creative Commons does not authorize the use of the trademark "Creative Commons" -or any other trademark or logo of Creative Commons without its prior written -consent including, without limitation, in connection with any unauthorized -modifications to any of its public licenses or any other arrangements, understandings, -or agreements concerning use of licensed material. For the avoidance of doubt, -this paragraph does not form part of the public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/MIT.txt b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/MIT.txt deleted file mode 100644 index 204b93da48..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/MIT.txt +++ /dev/null @@ -1,19 +0,0 @@ -MIT License Copyright (c) - -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 (including the next -paragraph) 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. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/Unlicense.txt b/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/Unlicense.txt deleted file mode 100644 index 24a8f90199..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/LICENSES/Unlicense.txt +++ /dev/null @@ -1,20 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or distribute -this software, either in source code form or as a compiled binary, for any -purpose, commercial or non-commercial, and by any means. - -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and -to the detriment of our heirs and successors. We intend this dedication to -be an overt act of relinquishment in perpetuity of all present and future -rights to this software under copyright law. - -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 -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. For more information, -please refer to diff --git a/frozen/Adafruit_CircuitPython_SSD1680/README.rst b/frozen/Adafruit_CircuitPython_SSD1680/README.rst deleted file mode 100644 index 0ff9a3382d..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/README.rst +++ /dev/null @@ -1,138 +0,0 @@ -Introduction -============ - -.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ssd1680/badge/?version=latest - :target: https://docs.circuitpython.org/projects/ssd1680/en/latest/ - :alt: Documentation Status - - -.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg - :target: https://adafru.it/discord - :alt: Discord - - -.. image:: https://github.com/adafruit/Adafruit_CircuitPython_SSD1680/workflows/Build%20CI/badge.svg - :target: https://github.com/adafruit/Adafruit_CircuitPython_SSD1680/actions - :alt: Build Status - - -.. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - :alt: Code Style: Black - -CircuitPython `displayio` driver for SSD1680-based ePaper displays - -Dependencies -============= -This driver depends on: - -* `Adafruit CircuitPython `_ - -Please ensure all dependencies are available on the CircuitPython filesystem. -This is easily achieved by downloading -`the Adafruit library and driver bundle `_ -or individual libraries can be installed using -`circup `_. - -* Adafruit 2.13" 250x122 Tri-Color eInk / ePaper Display with SRAM - SSD1680 Driver - -`Purchase the Breakout from the Adafruit shop `_ - -* Adafruit 2.13" HD Tri-Color eInk / ePaper Display FeatherWing - 250x122 RW Panel with SSD1680 - -`Purchase the FeatherWing from the Adafruit shop `_ - -Installing from PyPI -===================== - -On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from -PyPI `_. To install for current user: - -.. code-block:: shell - - pip3 install adafruit-circuitpython-ssd1680 - -To install system-wide (this may be required in some cases): - -.. code-block:: shell - - sudo pip3 install adafruit-circuitpython-ssd1680 - -To install in a virtual environment in your current project: - -.. code-block:: shell - - mkdir project-name && cd project-name - python3 -m venv .venv - source .venv/bin/activate - pip3 install adafruit-circuitpython-ssd1680 - -Usage Example -============= - -.. code-block:: python - - import time - import board - import displayio - import adafruit_ssd1680 - - displayio.release_displays() - - # This pinout works on a Metro M4 and may need to be altered for other boards. - spi = board.SPI() # Uses SCK and MOSI - epd_cs = board.D9 - epd_dc = board.D10 - epd_reset = board.D8 # Set to None for FeatherWing - epd_busy = board.D7 # Set to None for FeatherWing - - display_bus = displayio.FourWire( - spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000 - ) - time.sleep(1) - - display = adafruit_ssd1680.SSD1680( - display_bus, - width=250, - height=122, - busy_pin=epd_busy, - highlight_color=0xFF0000, - rotation=270, - ) - - g = displayio.Group() - - # CircuitPython 6 & 7 compatible - f = open("/display-ruler.bmp", "rb") - pic = displayio.OnDiskBitmap(f) - t = displayio.TileGrid( - pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter()) - ) - - # # CircuitPython 7 compatible only - # pic = displayio.OnDiskBitmap("/display-ruler.bmp") - # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) - - g.append(t) - - display.show(g) - - display.refresh() - print("refreshed") - - time.sleep(120) - - -Documentation -============= - -API documentation for this library can be found on `Read the Docs `_. - -For information on building library documentation, please check out `this guide `_. - -Contributing -============ - -Contributions are welcome! Please read our `Code of Conduct -`_ -before contributing to help this project stay welcoming. diff --git a/frozen/Adafruit_CircuitPython_SSD1680/README.rst.license b/frozen/Adafruit_CircuitPython_SSD1680/README.rst.license deleted file mode 100644 index 87eb036957..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/README.rst.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries -SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_SSD1680/adafruit_ssd1680.py b/frozen/Adafruit_CircuitPython_SSD1680/adafruit_ssd1680.py deleted file mode 100644 index 490725fed6..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/adafruit_ssd1680.py +++ /dev/null @@ -1,100 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries -# -# SPDX-License-Identifier: MIT -""" -`adafruit_ssd1680` -================================================================================ - -CircuitPython `displayio` driver for SSD1680-based ePaper displays - - -* Author(s): Melissa LeBlanc-Williams - -Implementation Notes --------------------- - -**Hardware:** - -* `Adafruit 2.13" Tri-Color eInk Display Breakout `_ -* `Adafruit 2.13" Tri-Color eInk Display FeatherWing `_ - - -**Software and Dependencies:** - -* Adafruit CircuitPython firmware for the supported boards: - https://github.com/adafruit/circuitpython/releases - -""" - -import displayio - -__version__ = "0.0.0+auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1680.git" - -_START_SEQUENCE = ( - b"\x12\x80\x14" # soft reset and wait 20ms - b"\x11\x01\x03" # Ram data entry mode - b"\x3C\x01\x05" # border color - b"\x2c\x01\x36" # Set vcom voltage - b"\x03\x01\x17" # Set gate voltage - b"\x04\x03\x41\x00\x32" # Set source voltage - b"\x4e\x01\x01" # ram x count - b"\x4f\x02\x00\x00" # ram y count - b"\x01\x03\x00\x00\x00" # set display size - b"\x22\x01\xf4" # display update mode -) - -_STOP_SEQUENCE = b"\x10\x81\x01\x64" # Deep Sleep -# pylint: disable=too-few-public-methods -class SSD1680(displayio.EPaperDisplay): - r"""SSD1680 driver - - :param bus: The data bus the display is on - :param \**kwargs: - See below - - :Keyword Arguments: - * *width* (``int``) -- - Display width - * *height* (``int``) -- - Display height - * *rotation* (``int``) -- - Display rotation - """ - - def __init__(self, bus: displayio.Fourwire, **kwargs) -> None: - stop_sequence = bytearray(_STOP_SEQUENCE) - try: - bus.reset() - except RuntimeError: - # No reset pin defined, so no deep sleeping - stop_sequence = b"" - - start_sequence = bytearray(_START_SEQUENCE) - width = kwargs["width"] - height = kwargs["height"] - if "rotation" in kwargs and kwargs["rotation"] % 180 != 90: - width, height = height, width - start_sequence[29] = (width - 1) & 0xFF - start_sequence[30] = ((width - 1) >> 8) & 0xFF - - super().__init__( - bus, - start_sequence, - stop_sequence, - **kwargs, - ram_width=250, - ram_height=296, - busy_state=True, - write_black_ram_command=0x24, - write_color_ram_command=0x26, - black_bits_inverted=False, - set_column_window_command=0x44, - set_row_window_command=0x45, - set_current_column_command=0x4E, - set_current_row_command=0x4F, - refresh_display_command=0x20, - colstart=1, - always_toggle_chip_select=True, - ) diff --git a/frozen/Adafruit_CircuitPython_SSD1680/docs/_static/favicon.ico b/frozen/Adafruit_CircuitPython_SSD1680/docs/_static/favicon.ico deleted file mode 100644 index 5aca98376a1f7e593ebd9cf41a808512c2135635..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4414 zcmd^BX;4#F6n=SG-XmlONeGrD5E6J{RVh+e928U#MG!$jWvO+UsvWh`x&VqGNx*en zx=qox7Dqv{kPwo%fZC$dDwVpRtz{HzTkSs8QhG0)%Y=-3@Kt!4ag|JcIo?$-F|?bXVS9UDUyev>MVZQ(H8K4#;BQW-t2CPorj8^KJrMX}QK zp+e<;4ldpXz~=)2GxNy811&)gt-}Q*yVQpsxr@VMoA##{)$1~=bZ1MmjeFw?uT(`8 z^g=09<=zW%r%buwN%iHtuKSg|+r7HkT0PYN*_u9k1;^Ss-Z!RBfJ?Un4w(awqp2b3 z%+myoFis_lTlCrGx2z$0BQdh+7?!JK#9K9@Z!VrG zNj6gK5r(b4?YDOLw|DPRoN7bdP{(>GEG41YcN~4r_SUHU2hgVtUwZG@s%edC;k7Sn zC)RvEnlq~raE2mY2ko64^m1KQL}3riixh?#J{o)IT+K-RdHae2eRX91-+g!y`8^># z-zI0ir>P%Xon)!@xp-BK2bDYUB9k613NRrY6%lVjbFcQc*pRqiK~8xtkNPLxt}e?&QsTB}^!39t_%Qb)~Ukn0O%iC;zt z<&A-y;3h++)>c1br`5VFM~5(83!HKx$L+my8sW_c#@x*|*vB1yU)_dt3vH;2hqPWx zAl^6@?ipx&U7pf`a*>Yq6C85nb+B=Fnn+(id$W#WB^uHAcZVG`qg;rWB}ubvi(Y>D z$ei>REw$#xp0SHAd^|1hq&9HJ=jKK8^zTH~nk)G?yUcmTh9vUM6Y0LMw4(gYVY$D$ zGl&WY&H<)BbJ&3sYbKjx1j^=3-0Q#f^}(aP1?8^`&FUWMp|rmtpK)bLQ1Zo?^s4jqK=Lfg*9&geMGVQ z#^-*!V`fG@;H&{M9S8%+;|h&Qrxym0Ar>WT4BCVLR8cGXF=JmEYN(sNT(9vl+S|%g z8r7nXQ(95i^`=+XHo|){$vf2$?=`F$^&wFlYXyXg$B{a>$-Fp+V}+D;9k=~Xl~?C4 zAB-;RKXdUzBJE{V&d&%R>aEfFe;vxqI$0@hwVM}gFeQR@j}a>DDxR+n+-*6|_)k%% z*mSpDV|=5I9!&VC&9tD%fcVygWZV!iIo2qFtm#!*(s|@ZT33*Ad;+<|3^+yrp*;oH zBSYLV(H1zTU?2WjrCQoQW)Z>J2a=dTriuvezBmu16`tM2fm7Q@d4^iqII-xFpwHGI zn9CL}QE*1vdj2PX{PIuqOe5dracsciH6OlAZATvE8rj6ykqdIjal2 z0S0S~PwHb-5?OQ-tU-^KTG@XNrEVSvo|HIP?H;7ZhYeZkhSqh-{reE!5di;1zk$#Y zCe7rOnlzFYJ6Z#Hm$GoidKB=2HBCwm`BbZVeZY4ukmG%1uz7p2URs6c9j-Gjj^oQV zsdDb3@k2e`C$1I5ML5U0Qs0C1GAp^?!*`=|Nm(vWz3j*j*8ucum2;r0^-6Aca=Gv) zc%}&;!+_*S2tlnnJnz0EKeRmw-Y!@9ob!XQBwiv}^u9MkaXHvM=!<3YX;+2#5Cj5pp?FEK750S3BgeSDtaE^ zXUM@xoV6yBFKfzvY20V&Lr0yC - Adafruit 2.13" HD Tri-Color eInk / ePaper Display FeatherWing - -.. toctree:: - :caption: Other Links - - Download from GitHub - Download Library Bundle - CircuitPython Reference Documentation - CircuitPython Support Forum - Discord Chat - Adafruit Learning System - Adafruit Blog - Adafruit Store - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst.license b/frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst.license deleted file mode 100644 index 52de478909..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/docs/index.rst.license +++ /dev/null @@ -1,4 +0,0 @@ -SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries - -SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_SSD1680/docs/requirements.txt b/frozen/Adafruit_CircuitPython_SSD1680/docs/requirements.txt deleted file mode 100644 index 88e67331eb..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/docs/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -sphinx>=4.0.0 diff --git a/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp b/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp deleted file mode 100644 index 726b5e026fd30b7e5baf5c23323d159b0eb5f65d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360122 zcmeI5J<>PHa@9vfU}y)p3NQ(_AVLn79IXQnhrqzWkgEj{fdQ^IAh~k216($MfjgY% z$@}EwoAuGByQ``{{-@)Ad$O}nW@Y`VDsR7YN29;`>woyK|MIu5>%ZVX{}KQByFdHw zw||TO{Mm2+>dXDxzsLK3{qKJJ{?E4qx4-%ifAgPyZ1%7JA_;#dE)Q`n<8kq849xm9 zbD2F6vEm7f70+r@8DW~ucsA2MQ4lBo#QIm(ELJ>ivEo_nQX1HZx8>QD_9@~x@u$>$ zRh?qRlNT$V)h?xXCnwzU>`MC-vCsM`1z%XFSn=@1if2VCfz+v*(Z7>vpCxkw&no+p zYQ>7jE>=9NUCP*_5QxW?XII*%h;6b@srK4B#fs-IRy?asWrS%qIo2tat)a&LE&O z$Ws+7vEm6xIfH=CAWv1S#EK^%vyzf0pnWA)JON&*eZ{kqk|&^jC00BEUa5V>vyzf0pnWA)JON&* zeZ{kqk|&^j^-xxS^S}QyepWn;KmUJ!%)|YExRzVmSId!q#DLmY{4!t8%KFm({O|v! z^Ml5I{Jdr;FK0DlQp$Nb0qrY(2`*t}A4|A*dQ|z!qVUmW20zD9%1c;{DqeYROF;XI zUz$r;9qU)#o$(0R%)DD(XOfBzQ0)?4+fauILnv445H z{=sc#X|6hhOl^15T*9hsRs=OWdffS$o>wkrb-rL_cmx6MD}I?)va%-Q%?ka;`jWLK`0dfUmUX9Oe>JF| zZ!^or&-A=RTXu|vhM(+7q0tE4ro&{gbL?N@Nx&wG&@{a5<);I6fn z_?`sToWXm}eQ#B3SXs0BYA?n26$<_z|LuSM{a=3nD`9_q`_-&|{~fO&fZ{%%P-3Vx3@hh^16*>$`Lcc<9iEYO_5}H!{8}Htc;KZwHH?tmScYeNS zlxtX>sqj9rU}e{RO1f<&0Cn5i?pD|uR`v;meuZD`SJua@BYpL&Uq7Po82eQU{Q6q^ zzAX8l9%lY!4Xc?mQ0_Yt(7xhVWeqF)vO;62_AC5x&pxic%KrHyp?!Mcj#t$`4_Zz% zG4(5cxuv`zfi-9Fh7&(f(i&E=U!lGDmy$Q7*rx1l^tj9et@Yt<#({|+2wB7GKw%1b zGy&}^e)*QMvfg6%KXs(aUoHEra+r%*`M5IPO+fpKU*E;7ykFr@cFd<#sX-tALzq}(^vu1@1c*Re1h;lKjAvIr>#Q**6Zd_H#{m0e5;@4;~EA$!E=3OhbBY%V-_NC~z zSR_%u;#XP9I}=!Z2Jehwv$n;otY4uj>qy>+lHtt?Mto&{yKhcyxL`4>;q@!wJqc)E z@$0gfmG!IGc49j++rFUeZc5kS5tsTEzrIr5pTOcXcz+A8%7;z>gnn?@MODV<8AP4L`?G%Ehck zm90ECC!l@BFVI!2tmk+y@~)NIl*>$jx46`=`1O_Y{sgW%gZC#>R(KUF>p6D!W`)PH zU-_4n8JGfOEu41)dY8v7~0@_zR{0mumck+Ja&B|X{Yk~l;@PolmZMgD6R>S9_ zg!dt!eZ{ZEg{-V8`9H*NkKVE{1$fM9UsmxIKf!^@3t0`Eg;L#(fc6!?A{Vlhuq% z)UV+8Hf4H#Qj?UIu$nX%rM(XU?JIsQE@$Qa3N>4U!X38tE1O8P`Kb+8Ue0RxjFj*W z1hlXCRk#nU`1h}@ersH?V^8C!He7ihR>P;JgclOfzT)BEjg@~&xxvq6w(@SQX3tmo z*AURY;yK@qm48av-?Q>hEPh7wly_q_Z>Gw;l7RLVPy24Hyg~W@I0%EE&Q#^ySWTU* zk}o5meZ`}`Eh{uG`_@vw;#c!NO8slw`L($18RVz1OnF;Y{-L!D#pXb_Wwlwk1a~H& zeZ{ZNJz3qbSpn%iS@CNv7^Zij`RL1f-lnKxdGrDpq2}6OeKS0i8jfs#u8?Pe95U1at;@s$wNpJOL?Z z5YQRqsfv|Y@dS7!_LW_H$j2%H>SO1=cj98j6B8?*m6SXI?JKe33GhnoE1s2DnZqeYJ_m1!CnWHVv`bL?poh0@_zRG_evZo`94y2Io2tat)a&LE&O z$Ws+7vEm6xIfH=CAWv1S#EK^%e)zyyADgmR9pl!DN<8DE*`=qIO8yTa5VypKO!@FM#p*D+R$xS0+NGzJ zNB$2X5VypKO!@FM#p*D+PM}kT5p9H&o=zUU`UC>LLq1`$C+8?uCjqv?4J>nSWsv_v z2wx|6>xH3JJ!swWbN zTjGiJudG?D#?l5)yFBfWe)zyyADgmR9pk1b5g0{4XOJf;R(n`| z{ma|+Uxqv}DH#GfgA66ph!xLDN)ebrKxdGrDpouzDMerg0i8jfs#x)?q!fV}1at;@ zs$#{nl2Qa_5YQRqsfrcPN=gx!K|p7arz%!FD=9@_1_7Nxo~l^!tfUly83Z1522tv@ z)m}ULjMZ085qK7X2c5yMZguHDfOzfb&)Qe2Rs?1cc+eUA>Q?GkGd975oVHlkuGfTV zDdoik9<-zE2wcePL98yMq@hJ%9)ZixAm4>}Vz--USPB>0!Jnlvw^6@jM^xcm(AU5Hmsf`2)yN%K-#5qJuL%g-R+ zg?Qy8_?NSqG%uwUfu|6-{0#D4h*wU6e>tm3^HN$7cnX2b&miB0c;zJcm$RBQFQpZM zrx3XO4DwxwS5AU|Ijc$YQd$vs3W3YdAm4>}Sr?ZN+#O@&E>2P)T|JOfNibn-NUPIJ5CGi2wJa>1y-ZHcsJ6Z?oURNZ9ZCfl2x5i zlLloT5zfd?YGRR7?UQx(!`HCt*Pyp!32g30A8u2b1QwW_%;T}ZYLpl6Mk>Jl$w;!z zM+;A~sxxZRpv)t}8QEb?EU$0><3Ij>@@M%Em%14^o7H9k5{xC#-;ilLmEu@T>ut;L zu`NN%Z-K41$?v1Mu_@^1@4u}kuR6V+y#})F4cVnn)!J~S6P}aJ3gMO(#-z)NpOjo_ zc>?AB;bUD{CaHR&{xAOGYmeF8{cgm!ug>u9Ne{A- z$^$YaPnRc2{`1YsG9az`l|z23kv30!B&Qrh`nD%bGWWYt6;z!bVn$U{b;iJ|pz7R= zih@o_QC1y@cg9q^Yz(nWze}9zx3PT0_*VUD7uXLM$DPx%JBV5#Rln!K+x}Na^=*ps zY|*G{QZ{H}2y7-Qg|wndSsJ|*@S|6iWkS+Zav%d48Is2fA^vFL{y3yxSvGxNF-!Ak zjc=PxqnxINr1J=8%i|eZf|lO`(_7CLjjE2qg-JgtOd8$$5h^c_qqtCP@IO#`zyO8I{Y-XbGNOmHQ~jPWg+o?);7t0I%^o|Nl+%^1%t>Dk=NU{{3e0mX zPc@1hu~kX(V~FG#{)i!L6f@%8T9A1*$1MX>2ZKQUY7^r-1aUKvHYQFgqm0K@J(x%p z{nc!YrVOk`#j#+QS2e1X9m`XVB1bH1sCtmC>L2LD5b3f$b8-meEc?~Toc(Z&*ca&S zG6GnObUJ2uc18-zRiiM3 zU&FtDklDJH4N)y%loLaYN~JvK3HYX(XT&0L?&2@LGCRJ7U3I$O!&8(ClHc`iR0UP1 zhrmbzdyE3JlZ+HpqpHp_A?aCg27NmXZ&o%(+`NZJd|Acn9@{fb-^$ru7Z+v?O`F;FW$ z)qr!i>u2G+LQH%ta5HLC&>7ug<2}u*n!M_afiWRzW3fo(VOeWG6n^ZSgFk&=9bTPB z2Vx6h{~x~F+*=t+GV!eS?HIeMOahNh{>~#4Vw#i$&eGFz`Y0^{lPYRrLej=slgh)g zqA%4Q=s72U$UEs1&gQ;=)nUk=8Cc&*KVC5TF)M#{VwHF8LlKW#%l6D}^p)wYN5M$1 zs*j}JWGO@GEIkM*ugyFjm6Y+ZOuOm9Vr^>92&$W*>O9%35RSC!S7#RMiLu!KSoiAP zr_*^`jrG7aMm)l>&s+mjohc*6jx7o66_XFQk)OPV^ec=tuVo?ma6U?Sl0biV#pF=p z?AYD??ul>RcG*;8;E5iXYSfg+mV~7lRalt^$;pdvR;ai7Lk1g5{i0t>yHtVg{Vi6CcTD1zGA>RzIAU0go^yT{hOFrwq`#^QcXPMj2Mtpj&MbSCz5Am3r8SgCns#O`DRMGwaH zNA;_DtMKm3*g^-|l{PXL>z+Jf94!x?2?(|H>Ql0B6G z7I$8LZ%1a71Gzx`s)Qp?hX8g?r-9&Yj7>_sN*+9(`NgqhPbH96cI;T*j?5^NyFmS_ zgdto4SKmZFmZxketS2>WsRlh3XJlf+cJA4+%Og0n9 z%AeO$zS`^YR5F$k!0OK%%QvkV6Bc8O8{A31&pCqvN6R6b30?N0Wo)|8BJ%Oob(A&|b zvA17YkBWEotM!{_{fO8|XelS}UN)J>^)fCefF+w(1Co;$->>>g3N&(s`*W6&wp8Y24Ha;%j))KUvyE6lg_Z#E)QfXwPw z*Y2oEqhn?LD~PnMl3h`gidWiE1hDj@Qk8j-JYB9yezF~H%8*w5$|1kWIQ*G(IPgvM zUNaXQ@Og7dP07YGCkBmgHyaTtKu-0mc?)`N=FKmqYI&WgvXxac$axIZOSawyy;BJ{JymKuR;6WVQOVxYI*KZt!n5Hzya^PJ^3njBukY%{M>a})^l{BewxdlMvZ-I4-xcr6P`0M3 z=Y11@*^Inz%$S$;A{)Z(Xkbu#+-yXo0NK>9W-R5?b5^@kaz1^IpHM#z_`GR)Yr+t2 zC&ONm?PybmQV90M&E2iqyU-KujVc2qcfKc zDtR6~yALVeTgr_2TJqSPsy2ou+tH>B`PHvxEaf|LrUn%s-!Z}0&%#>Dq-k36YL80J z%|=8DkXHR_(rUgVZR}Cee#h)yKMQLqlct%PQs-m-36 zp$aPr%szw2j|SqqceXLFSpnT_R^{r*GnIh;FgO+OjO03lJXNvcSxG4ZGYIGm@>Io& zXCIo&XCHklHIv&V)N@*Z}iVZ=w{0M9NUK7<>)!Vie|R(N2D*Mx}G@TH7MZO_{f<}W?N3wU2bgI4`s!mHG; zj580xlKb7W?ajlFn3T%~O5;B9QLKiqT10Ag|318cHzfo*T;4-qR3Gr>Bqqb>XvFGs*7^}Mwf^8;0xiOAvVQ38YU%N|^~yVv8z#0gU?+bo&n|zbo?Ur9 zK`d7MDr1}5j}MV@F9GWbsWYHUFc+fi>We#?p9J}@NC=muwU*_N{jr$015+`>m6{SS z<0M6mM2lP2O^r`CH0KeoQA_ zj3c`V$V7Samz3ocC z#3=FQtVT^ldEP_-+tMzZl-awE%uj;mUrSt&#!h86oKcw`A-$E4vnqr6G*K5AtpDNr^{qIA+8<-j;;R4CaZ-YG4!`uxI4lRR+_YO3khz zMu{(HHEJTt^Hu_7(?~Nl0q!_cc2BJ-KAH_#N@9;mX_;NwigLj*V^Uha7|c3dj3us(zF+RX8dwp9gb{mvczY_;{6l zIjgHCu5q75AoUr0^pj-mE2?8{kQHSrna z+TM;kobjNNxC+tsB0G6pV}>c+nX-AFD2O4Zk9SvIZg}x#*s+40j@xFPHoGLVJbqMR zxXg_dGU{=5{>?fQK!*?mlP11eX4|!?Tb}Z5 ztmh6kDzsx2r@#~jeKo}V)jN~+jHX)8nS^^|Q!i4#+6(ZB`nc=NW;{02QW*)f-bR0! zCuV59jTy`??`57lc&yHJ&{~B-9IvX(52+cZuPTQ-G1l;$yAmdhjv^*Wn)qs^eL1U@ zlbt$Ch2@EJ2mAEsy!*+cMi7JgBf* zr1@K~%F1K2vO`^J=6R}h&KOSpY6jKY=EP^a{aO{4$HYCpC*9*olE;+MX&%$NZ30gM zBZfqOv`bC$_#=!Mcw0Lb>~^c#)}&&;vLvkxGyJWphL5FwH5}<%6ZZFH|1HmCR33iB zXDO?E;7t8$@uaF%&8R{BY6jI;=G@$q5Nv7^nNnYRQpkrtR{6l0uEmrv`kE2duhwwZ zC{+T>_IY*m$2qMjRm=A8tB$4`IK;VZ9o4Ufte29AzyboTUgXWnj`M;_(h%xb2}tL0 z8LLhWdL;r22(-4k_p4Szn_XM0u;Js9-&a1a0olAG?Xqhbt7S9NKq62jP~GZq#(q@| zob9X@He=AuepMY5<@GQ1t134+Mc^<2oVaRiI*C=yY-g*s;p6uERcE+FDLtxRbIpb&_G<|ajI}pp+0dPSwOMoOQSnjzYLlJ>BCv}8I^`Y6)(OF6eGd;b)UP_s^-2Wx64-1An}WR~?$R$C zUHxj;x=1Vn>j^O3fYHpWeA(#gSMwH8nMGg-fz58PDHu{lC&{t`)UP_LpjRSr2LhYj zU{f%A7Rw4?`c;}NYTLY!cG-numW`!>S_FJcv;^`WCa}4~Hw74a>XBp$I6VCrxY@6w z*lpjOEn_MiFT;#wtkSr8tP;?2RI!|KZX(?jV00YGd8d*o;0yte?e{B};SJWw!k8@!{NKQFeE+%V3x?dSrJ9M3ODpre^ke+$^9~`Cfmg zUwJBTR(#8v&Btqlv5Zw5^sRP;X?FC)Sx0|qmmZ6a{+La6ivUTiFPnWH`=hs}cEGQG zbpYCnL*m9WJ9^^8qrbFEkHtoR%qF`?dHfNEYiv2vqbc1P17&vz7|f1gog=K|5O2|{SK!c8+cVcWKSSvqnRxFVpqQ!yKu^OhCsDndBXl% zmn}2a*MnZvX-ECHQ?Yca8auA~)mWY{$X0$oBv196CJi{a$Mx<>l+0fZX*u0*2JUvX z#&SPoE!$psF-d9pqbBC@w+jsGOV#^=(W^tKUsbVGoy%BNM}L_!o6gmVQz}bO z8C80YMV-&nAJ^V~?0wl8)c4iL?y>5`dfqOTrN>5(_fiu*{c2;L544w^ zL499+;O^>7IiApt9bX|^d^EfC*r3s0dg5C?4--{tN(iL}p6IO3w9NB?9`!4J(U-B} zOM0}@4rx56>Dbz0#)_sAw~> z(hMiC>R0^QEn~%(B&7&^6oF-DP~TS{wXZZ;5tu<> zS-+Z5{NkKqwHUaD6M;lPXD|WjJc?BZj$Vnt0s=aNJY=!rSxG4ZGYIGm@>Io&XSJ!s z|9%Ia?fdu3pW9|O2|k3t*N)M}5fCem6Q%lTMa{p)EFvFie6p>bz^}eo?P6t}s1;&w zz42NKbP28Q%A$nlD|I>`fL9EEt_YK3)<8!8L>9Li^iivk$M-Q>L$NZjT zuhAd0^>*(lFVII6m`;2&J9*;c3#QLcAx^wXrlc1`_<>%gBw3xAHHP@UsE;dOCWQE) zqij#O*XS3}db@X&cj#L*%%9%I$9GKsz$~g{kSD@{9Ul*j^4t)cyWdMPRnM{c`X~%- z)5NFf;VYc1lPTRE*-)ZdjM_lMee>l%rUL=yV>@)c-Hcg`(sPvp4^obct z4x64Rc;b`~*BmEq_NFHa4v+ijKoBqpcDK1yJ!m!d^Z9;7eqZj1#?Q-N{u%|lY-FkG zqrYWW1NS;(a>U}%F3`uwQ?hcszjBXf za1V@_E!t7T+tnfX@Wsk!Rl68Y8cwVdkj|r6b>Q@0MRd{jC^+ph4{U$+dgG%edvZ0! ziU%lGJgcMxI;ZDGRr4+Upk@UKEg*@H9>r?c9?-tpg)52;UA)J)%j|o8wP|1R8$hg{ z&g!0LFj4hw2E*;7S@3vIRu=;4Fc+&1ob*bp5|Ga0Jz1rK;fsEF-`VbjzY{`uF<8>goHcUw?mn`{!4&k*!$$ zN+UjHTdX1xouglAV0Sb>8`^Kaa&!W}-^OvWt=LFJoPVX!+>nro)rYg{v<~f!58oSc T`pMSbh(J1r2r{u6#p?e9C4JK7 diff --git a/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp.license b/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp.license deleted file mode 100644 index a784acfa32..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/examples/display-ruler.bmp.license +++ /dev/null @@ -1,2 +0,0 @@ -# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries -# SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_SSD1680/examples/ssd1680_simpletest.py b/frozen/Adafruit_CircuitPython_SSD1680/examples/ssd1680_simpletest.py deleted file mode 100644 index 48a4d4d8bd..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/examples/ssd1680_simpletest.py +++ /dev/null @@ -1,60 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -"""Simple test script for 2.13" 250x122 tri-color display. -Supported products: - * Adafruit 2.13" Tri-Color eInk Display Breakout - * https://www.adafruit.com/product/4947 - * Adafruit 2.13" Tri-Color eInk Display FeatherWing - * https://www.adafruit.com/product/4814 -""" - -import time -import board -import displayio -import adafruit_ssd1680 - -displayio.release_displays() - -# This pinout works on a Metro M4 and may need to be altered for other boards. -spi = board.SPI() # Uses SCK and MOSI -epd_cs = board.D9 -epd_dc = board.D10 -epd_reset = board.D8 # Set to None for FeatherWing -epd_busy = board.D7 # Set to None for FeatherWing - -display_bus = displayio.FourWire( - spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000 -) -time.sleep(1) - -display = adafruit_ssd1680.SSD1680( - display_bus, - width=250, - height=122, - busy_pin=epd_busy, - highlight_color=0xFF0000, - rotation=270, -) - -g = displayio.Group() - -with open("/display-ruler.bmp", "rb") as f: - pic = displayio.OnDiskBitmap(f) - # CircuitPython 6 & 7 compatible - t = displayio.TileGrid( - pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter()) - ) - # CircuitPython 7 compatible only - # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) - g.append(t) - - display.show(g) - - display.refresh() - - print("refreshed") - - time.sleep(120) diff --git a/frozen/Adafruit_CircuitPython_SSD1680/optional_requirements.txt b/frozen/Adafruit_CircuitPython_SSD1680/optional_requirements.txt deleted file mode 100644 index d4e27c4d74..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/optional_requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense diff --git a/frozen/Adafruit_CircuitPython_SSD1680/pyproject.toml b/frozen/Adafruit_CircuitPython_SSD1680/pyproject.toml deleted file mode 100644 index b36b2d7afb..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/pyproject.toml +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -[build-system] -requires = [ - "setuptools", - "wheel", - "setuptools-scm", -] - -[project] -name = "adafruit-circuitpython-ssd1680" -description = "CircuitPython `displayio` drivers for SSD1680-based ePaper displays" -version = "0.0.0+auto.0" -readme = "README.rst" -authors = [ - {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} -] -urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1680"} -keywords = [ - "adafruit", - "blinka", - "circuitpython", - "micropython", - "ssd1680", - "displayio", - "epd", - "epaper", -] -license = {text = "MIT"} -classifiers = [ - "Intended Audience :: Developers", - "Topic :: Software Development :: Libraries", - "Topic :: Software Development :: Embedded Systems", - "Topic :: System :: Hardware", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", -] -dynamic = ["dependencies", "optional-dependencies"] - -[tool.setuptools] -py-modules = ["adafruit_ssd1680"] - -[tool.setuptools.dynamic] -dependencies = {file = ["requirements.txt"]} -optional-dependencies = {optional = {file = ["optional_requirements.txt"]}} diff --git a/frozen/Adafruit_CircuitPython_SSD1680/requirements.txt b/frozen/Adafruit_CircuitPython_SSD1680/requirements.txt deleted file mode 100644 index 7a984a4739..0000000000 --- a/frozen/Adafruit_CircuitPython_SSD1680/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -Adafruit-Blinka From 8c41eb900ea940f1348cfa0e982a00ddc829b48a Mon Sep 17 00:00:00 2001 From: dronecz Date: Mon, 31 Oct 2022 21:39:12 +0100 Subject: [PATCH 032/357] Delete frozen/Adafruit_CircuitPython_UC8151D directory --- .../adafruit_circuitpython_pr.md | 13 - .../.github/workflows/build.yml | 77 ---- .../.github/workflows/failure-help-text.yml | 19 - .../.github/workflows/release.yml | 88 ---- .../Adafruit_CircuitPython_UC8151D/.gitignore | 47 -- .../.pre-commit-config.yaml | 42 -- .../Adafruit_CircuitPython_UC8151D/.pylintrc | 436 ------------------ .../.readthedocs.yaml | 19 - .../CODE_OF_CONDUCT.md | 141 ------ frozen/Adafruit_CircuitPython_UC8151D/LICENSE | 21 - .../LICENSES/CC-BY-4.0.txt | 324 ------------- .../LICENSES/MIT.txt | 19 - .../LICENSES/Unlicense.txt | 20 - .../Adafruit_CircuitPython_UC8151D/README.rst | 149 ------ .../README.rst.license | 3 - .../adafruit_uc8151d.py | 132 ------ .../docs/_static/favicon.ico | Bin 4414 -> 0 bytes .../docs/_static/favicon.ico.license | 3 - .../docs/api.rst | 8 - .../docs/api.rst.license | 4 - .../docs/conf.py | 195 -------- .../docs/examples.rst | 8 - .../docs/examples.rst.license | 4 - .../docs/index.rst | 51 -- .../docs/index.rst.license | 4 - .../docs/requirements.txt | 5 - .../examples/display-ruler.bmp | Bin 360122 -> 0 bytes .../examples/display-ruler.bmp.license | 2 - .../examples/uc8151d_grayscale_test.py | 68 --- .../examples/uc8151d_simpletest.py | 48 -- .../optional_requirements.txt | 3 - .../pyproject.toml | 50 -- .../requirements.txt | 6 - 33 files changed, 2009 deletions(-) delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/build.yml delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/failure-help-text.yml delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/release.yml delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.gitignore delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.pre-commit-config.yaml delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.pylintrc delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/.readthedocs.yaml delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/CODE_OF_CONDUCT.md delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/LICENSE delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/LICENSES/CC-BY-4.0.txt delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/LICENSES/MIT.txt delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/LICENSES/Unlicense.txt delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/README.rst delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/README.rst.license delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/adafruit_uc8151d.py delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/_static/favicon.ico delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/_static/favicon.ico.license delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/api.rst delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/api.rst.license delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/conf.py delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/examples.rst delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/examples.rst.license delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst.license delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/docs/requirements.txt delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp.license delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_grayscale_test.py delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_simpletest.py delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/optional_requirements.txt delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/pyproject.toml delete mode 100644 frozen/Adafruit_CircuitPython_UC8151D/requirements.txt diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md b/frozen/Adafruit_CircuitPython_UC8151D/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md deleted file mode 100644 index 8de294e68a..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Adafruit Industries -# -# SPDX-License-Identifier: MIT - -Thank you for contributing! Before you submit a pull request, please read the following. - -Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html - -If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs - -Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code - -Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/build.yml b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/build.yml deleted file mode 100644 index cb2f60e36a..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/build.yml +++ /dev/null @@ -1,77 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -name: Build CI - -on: [pull_request, push] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Translate Repo Name For Build Tools filename_prefix - id: repo-name - run: | - echo ::set-output name=repo-name::$( - echo ${{ github.repository }} | - awk -F '\/' '{ print tolower($2) }' | - tr '_' '-' - ) - - name: Set up Python 3.x - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Versions - run: | - python3 --version - - name: Checkout Current Repo - uses: actions/checkout@v1 - with: - submodules: true - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: adafruit/actions-ci-circuitpython-libs - path: actions-ci - - name: Install dependencies - # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.) - run: | - source actions-ci/install.sh - - name: Pip install Sphinx, pre-commit - run: | - pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit - - name: Library version - run: git describe --dirty --always --tags - - name: Setup problem matchers - uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 - - name: Pre-commit hooks - run: | - pre-commit run --all-files - - name: Build assets - run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . - - name: Archive bundles - uses: actions/upload-artifact@v2 - with: - name: bundles - path: ${{ github.workspace }}/bundles/ - - name: Build docs - working-directory: docs - run: sphinx-build -E -W -b html . _build/html - - name: Check For pyproject.toml - id: need-pypi - run: | - echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) - - name: Build Python package - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - run: | - pip install --upgrade build twine - for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0+auto.0/1.2.3/" $file; - done; - python -m build - twine check dist/* diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/failure-help-text.yml b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/failure-help-text.yml deleted file mode 100644 index 0b1194f0cd..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/failure-help-text.yml +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -name: Failure help text - -on: - workflow_run: - workflows: ["Build CI"] - types: - - completed - -jobs: - post-help: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }} - steps: - - name: Post comment to help - uses: adafruit/circuitpython-action-library-ci-failed@v1 diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/release.yml b/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/release.yml deleted file mode 100644 index f3a0325ba3..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/.github/workflows/release.yml +++ /dev/null @@ -1,88 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -name: Release Actions - -on: - release: - types: [published] - -jobs: - upload-release-assets: - runs-on: ubuntu-latest - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Translate Repo Name For Build Tools filename_prefix - id: repo-name - run: | - echo ::set-output name=repo-name::$( - echo ${{ github.repository }} | - awk -F '\/' '{ print tolower($2) }' | - tr '_' '-' - ) - - name: Set up Python 3.x - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Versions - run: | - python3 --version - - name: Checkout Current Repo - uses: actions/checkout@v1 - with: - submodules: true - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: adafruit/actions-ci-circuitpython-libs - path: actions-ci - - name: Install deps - run: | - source actions-ci/install.sh - - name: Build assets - run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . - - name: Upload Release Assets - # the 'official' actions version does not yet support dynamically - # supplying asset names to upload. @csexton's version chosen based on - # discussion in the issue below, as its the simplest to implement and - # allows for selecting files with a pattern. - # https://github.com/actions/upload-release-asset/issues/4 - #uses: actions/upload-release-asset@v1.0.1 - uses: csexton/release-asset-action@master - with: - pattern: "bundles/*" - github-token: ${{ secrets.GITHUB_TOKEN }} - - upload-pypi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Check For pyproject.toml - id: need-pypi - run: | - echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) - - name: Set up Python - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - run: | - python -m pip install --upgrade pip - pip install --upgrade build twine - - name: Build and publish - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - env: - TWINE_USERNAME: ${{ secrets.pypi_username }} - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: | - for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file; - done; - python -m build - twine upload dist/* diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.gitignore b/frozen/Adafruit_CircuitPython_UC8151D/.gitignore deleted file mode 100644 index 544ec4a695..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/.gitignore +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -# Do not include files and directories created by your personal work environment, such as the IDE -# you use, except for those already listed here. Pull requests including changes to this file will -# not be accepted. - -# This .gitignore file contains rules for files generated by working with CircuitPython libraries, -# including building Sphinx, testing with pip, and creating a virual environment, as well as the -# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs. - -# If you find that there are files being generated on your machine that should not be included in -# your git commit, you should create a .gitignore_global file on your computer to include the -# files created by your personal setup. To do so, follow the two steps below. - -# First, create a file called .gitignore_global somewhere convenient for you, and add rules for -# the files you want to exclude from git commits. - -# Second, configure Git to use the exclude file for all Git repositories by running the -# following via commandline, replacing "path/to/your/" with the actual path to your newly created -# .gitignore_global file: -# git config --global core.excludesfile path/to/your/.gitignore_global - -# CircuitPython-specific files -*.mpy - -# Python-specific files -__pycache__ -*.pyc - -# Sphinx build-specific files -_build - -# This file results from running `pip -e install .` in a local repository -*.egg-info - -# Virtual environment-specific files -.env - -# MacOS-specific files -*.DS_Store - -# IDE-specific files -.idea -.vscode -*~ diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.pre-commit-config.yaml b/frozen/Adafruit_CircuitPython_UC8151D/.pre-commit-config.yaml deleted file mode 100644 index 3343606412..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/.pre-commit-config.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò -# -# SPDX-License-Identifier: Unlicense - -repos: - - repo: https://github.com/python/black - rev: 22.3.0 - hooks: - - id: black - - repo: https://github.com/fsfe/reuse-tool - rev: v0.14.0 - hooks: - - id: reuse - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 - hooks: - - id: check-yaml - - id: end-of-file-fixer - - id: trailing-whitespace - - repo: https://github.com/pycqa/pylint - rev: v2.11.1 - hooks: - - id: pylint - name: pylint (library code) - types: [python] - args: - - --disable=consider-using-f-string - exclude: "^(docs/|examples/|tests/|setup.py$)" - - id: pylint - name: pylint (example code) - description: Run pylint rules on "examples/*.py" files - types: [python] - files: "^examples/" - args: - - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code - - id: pylint - name: pylint (test code) - description: Run pylint rules on "tests/*.py" files - types: [python] - files: "^tests/" - args: - - --disable=missing-docstring,consider-using-f-string,duplicate-code diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.pylintrc b/frozen/Adafruit_CircuitPython_UC8151D/.pylintrc deleted file mode 100644 index 1f42e5de32..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/.pylintrc +++ /dev/null @@ -1,436 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -[MASTER] - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code -extension-pkg-whitelist= - -# Add files or directories to the ignore-list. They should be base names, not -# paths. -ignore=CVS - -# Add files or directories matching the regex patterns to the ignore-list. The -# regex matches against base names, not paths. -ignore-patterns= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. -jobs=1 - -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins= - -# Pickle collected data for later comparisons. -persistent=yes - -# Specify a configuration file. -#rcfile= - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED -confidence= - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call -disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,pointless-string-statement,unspecified-encoding - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable= - - -[REPORTS] - -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details -#msg-template= - -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio).You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. -output-format=text - -# Tells whether to display a full report or only the messages -reports=no - -# Activate the evaluation score. -score=yes - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - - -[LOGGING] - -# Logging modules to check that the string format arguments are in logging -# function parameter format -logging-modules=logging - - -[SPELLING] - -# Spelling dictionary name. Available dictionaries: none. To make it working -# install python-enchant package. -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. -spelling-store-unknown-words=no - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -# notes=FIXME,XXX,TODO -notes=FIXME,XXX - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules=board - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_,_cb - -# A regular expression matching the name of dummy variables (i.e. expectedly -# not used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. Default to name -# with leading underscore -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,future.builtins - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -# expected-line-ending-format= -expected-line-ending-format=LF - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=100 - -# Maximum number of lines in a module -max-module-lines=1000 - -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=yes - -# Minimum lines number of a similarity. -min-similarity-lines=12 - - -[BASIC] - -# Naming hint for argument names -argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct argument names -argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Naming hint for attribute names -attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct attribute names -attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Bad variable names which should always be refused, separated by a comma -bad-names=foo,bar,baz,toto,tutu,tata - -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Regular expression matching correct class attribute names -class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Naming hint for class names -# class-name-hint=[A-Z_][a-zA-Z0-9]+$ -class-name-hint=[A-Z_][a-zA-Z0-9_]+$ - -# Regular expression matching correct class names -# class-rgx=[A-Z_][a-zA-Z0-9]+$ -class-rgx=[A-Z_][a-zA-Z0-9_]+$ - -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Regular expression matching correct constant names -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming hint for function names -function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct function names -function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Good variable names which should always be accepted, separated by a comma -# good-names=i,j,k,ex,Run,_ -good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_ - -# Include a hint for the correct naming format with invalid-name -include-naming-hint=no - -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ - -# Regular expression matching correct inline iteration names -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ - -# Naming hint for method names -method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct method names -method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Regular expression matching correct module names -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -property-classes=abc.abstractproperty - -# Naming hint for variable names -variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct variable names -variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - - -[IMPORTS] - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=optparse,tkinter.tix - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled) -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled) -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled) -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__,__new__,setUp - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict,_fields,_replace,_source,_make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[DESIGN] - -# Maximum number of arguments for function / method -max-args=5 - -# Maximum number of attributes for a class (see R0902). -# max-attributes=7 -max-attributes=11 - -# Maximum number of boolean expressions in a if statement -max-bool-expr=5 - -# Maximum number of branch for function / method body -max-branches=12 - -# Maximum number of locals for function / method body -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body -max-returns=6 - -# Maximum number of statements in function / method body -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=1 - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception diff --git a/frozen/Adafruit_CircuitPython_UC8151D/.readthedocs.yaml b/frozen/Adafruit_CircuitPython_UC8151D/.readthedocs.yaml deleted file mode 100644 index 33c2a6108e..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/.readthedocs.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -build: - os: ubuntu-20.04 - tools: - python: "3" - -python: - install: - - requirements: docs/requirements.txt - - requirements: requirements.txt diff --git a/frozen/Adafruit_CircuitPython_UC8151D/CODE_OF_CONDUCT.md b/frozen/Adafruit_CircuitPython_UC8151D/CODE_OF_CONDUCT.md deleted file mode 100644 index 01a7515796..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,141 +0,0 @@ - -# Adafruit Community Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and leaders pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level or type of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -We are committed to providing a friendly, safe and welcoming environment for -all. - -Examples of behavior that contributes to creating a positive environment -include: - -* Be kind and courteous to others -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Collaborating with other community members -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and sexual attention or advances -* The use of inappropriate images, including in a community member's avatar -* The use of inappropriate language, including in a community member's nickname -* Any spamming, flaming, baiting or other attention-stealing behavior -* Excessive or unwelcome helping; answering outside the scope of the question - asked -* Discussion or promotion of activities or projects that intend or pose a risk of - significant harm -* Trolling, insulting/derogatory comments, and personal or political attacks -* Promoting or spreading disinformation, lies, or conspiracy theories against - a person, group, organisation, project, or community -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate - -The goal of the standards and moderation guidelines outlined here is to build -and maintain a respectful community. We ask that you don’t just aim to be -"technically unimpeachable", but rather try to be your best self. - -We value many things beyond technical expertise, including collaboration and -supporting others within our community. Providing a positive experience for -other community members can have a much more significant impact than simply -providing the correct answer. - -## Our Responsibilities - -Project leaders are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project leaders have the right and responsibility to remove, edit, or -reject messages, comments, commits, code, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any community member for other behaviors that they deem -inappropriate, threatening, offensive, or harmful. - -## Moderation - -Instances of behaviors that violate the Adafruit Community Code of Conduct -may be reported by any member of the community. Community members are -encouraged to report these situations, including situations they witness -involving other community members. - -You may report in the following ways: - -In any situation, you may email . - -On the Adafruit Discord, you may send an open message from any channel -to all Community Moderators by tagging @community moderators. You may -also send an open message from any channel, or a direct message to -any Community Moderator. - -Email and direct message reports will be kept confidential. - -In situations on Discord where the issue is particularly offensive, possibly -illegal, requires immediate action, or violates the Discord terms of service, -you should also report the message directly to [Discord](https://discord.com/safety). - -These are the steps for upholding our community’s standards of conduct. - -1. Any member of the community may report any situation that violates the - CircuitPython Community Code of Conduct. All reports will be reviewed and - investigated. -2. If the behavior is a severe violation, the community member who - committed the violation may be banned immediately, without warning. -3. Otherwise, moderators will first respond to such behavior with a warning. -4. Moderators follow a soft "three strikes" policy - the community member may - be given another chance, if they are receptive to the warning and change their - behavior. -5. If the community member is unreceptive or unreasonable when warned by a - moderator, or the warning goes unheeded, they may be banned for a first or - second offense. Repeated offenses will result in the community member being - banned. -6. Disciplinary actions (warnings, bans, etc) for Code of Conduct violations apply - to the platform where the violation occurred. However, depending on the severity - of the violation, the disciplinary action may be applied across Adafruit's other - community platforms. For example, a severe violation on the Adafruit Discord - server may result in a ban on not only the Adafruit Discord server, but also on - the Adafruit GitHub organisation, Adafruit Forums, Adafruit Twitter, etc. - -## Scope - -This Code of Conduct and the enforcement policies listed above apply to all -Adafruit Community venues. This includes but is not limited to any community -spaces (both public and private), the entire Adafruit Discord server, and -Adafruit GitHub repositories. Examples of Adafruit Community spaces include -but are not limited to meet-ups, audio chats on the Adafruit Discord, or -interaction at a conference. - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. As a community -member, you are representing our community, and are expected to behave -accordingly. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), -version 1.4, available on [contributor-covenant.org](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), -and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). - -For other projects adopting the Adafruit Community Code of -Conduct, please contact the maintainers of those projects for enforcement. -If you wish to use this code of conduct for your own project, consider -explicitly mentioning your moderation policy or making a copy with your -own moderation policy so as to avoid confusion. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/LICENSE b/frozen/Adafruit_CircuitPython_UC8151D/LICENSE deleted file mode 100644 index 88160406de..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2021 Melissa LeBlanc-Williams 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. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/CC-BY-4.0.txt b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/CC-BY-4.0.txt deleted file mode 100644 index 3f92dfc5fd..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/CC-BY-4.0.txt +++ /dev/null @@ -1,324 +0,0 @@ -Creative Commons Attribution 4.0 International Creative Commons Corporation -("Creative Commons") is not a law firm and does not provide legal services -or legal advice. Distribution of Creative Commons public licenses does not -create a lawyer-client or other relationship. Creative Commons makes its licenses -and related information available on an "as-is" basis. Creative Commons gives -no warranties regarding its licenses, any material licensed under their terms -and conditions, or any related information. Creative Commons disclaims all -liability for damages resulting from their use to the fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and conditions -that creators and other rights holders may use to share original works of -authorship and other material subject to copyright and certain other rights -specified in the public license below. The following considerations are for -informational purposes only, are not exhaustive, and do not form part of our -licenses. - -Considerations for licensors: Our public licenses are intended for use by -those authorized to give the public permission to use material in ways otherwise -restricted by copyright and certain other rights. Our licenses are irrevocable. -Licensors should read and understand the terms and conditions of the license -they choose before applying it. Licensors should also secure all rights necessary -before applying our licenses so that the public can reuse the material as -expected. Licensors should clearly mark any material not subject to the license. -This includes other CC-licensed material, or material used under an exception -or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors - -Considerations for the public: By using one of our public licenses, a licensor -grants the public permission to use the licensed material under specified -terms and conditions. If the licensor's permission is not necessary for any -reason–for example, because of any applicable exception or limitation to copyright–then -that use is not regulated by the license. Our licenses grant only permissions -under copyright and certain other rights that a licensor has authority to -grant. Use of the licensed material may still be restricted for other reasons, -including because others have copyright or other rights in the material. A -licensor may make special requests, such as asking that all changes be marked -or described. Although not required by our licenses, you are encouraged to -respect those requests where reasonable. More considerations for the public -: wiki.creativecommons.org/Considerations_for_licensees Creative Commons Attribution -4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree to -be bound by the terms and conditions of this Creative Commons Attribution -4.0 International Public License ("Public License"). To the extent this Public -License may be interpreted as a contract, You are granted the Licensed Rights -in consideration of Your acceptance of these terms and conditions, and the -Licensor grants You such rights in consideration of benefits the Licensor -receives from making the Licensed Material available under these terms and -conditions. - -Section 1 – Definitions. - -a. Adapted Material means material subject to Copyright and Similar Rights -that is derived from or based upon the Licensed Material and in which the -Licensed Material is translated, altered, arranged, transformed, or otherwise -modified in a manner requiring permission under the Copyright and Similar -Rights held by the Licensor. For purposes of this Public License, where the -Licensed Material is a musical work, performance, or sound recording, Adapted -Material is always produced where the Licensed Material is synched in timed -relation with a moving image. - -b. Adapter's License means the license You apply to Your Copyright and Similar -Rights in Your contributions to Adapted Material in accordance with the terms -and conditions of this Public License. - -c. Copyright and Similar Rights means copyright and/or similar rights closely -related to copyright including, without limitation, performance, broadcast, -sound recording, and Sui Generis Database Rights, without regard to how the -rights are labeled or categorized. For purposes of this Public License, the -rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. - -d. Effective Technological Measures means those measures that, in the absence -of proper authority, may not be circumvented under laws fulfilling obligations -under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, -and/or similar international agreements. - -e. Exceptions and Limitations means fair use, fair dealing, and/or any other -exception or limitation to Copyright and Similar Rights that applies to Your -use of the Licensed Material. - -f. Licensed Material means the artistic or literary work, database, or other -material to which the Licensor applied this Public License. - -g. Licensed Rights means the rights granted to You subject to the terms and -conditions of this Public License, which are limited to all Copyright and -Similar Rights that apply to Your use of the Licensed Material and that the -Licensor has authority to license. - -h. Licensor means the individual(s) or entity(ies) granting rights under this -Public License. - -i. Share means to provide material to the public by any means or process that -requires permission under the Licensed Rights, such as reproduction, public -display, public performance, distribution, dissemination, communication, or -importation, and to make material available to the public including in ways -that members of the public may access the material from a place and at a time -individually chosen by them. - -j. Sui Generis Database Rights means rights other than copyright resulting -from Directive 96/9/EC of the European Parliament and of the Council of 11 -March 1996 on the legal protection of databases, as amended and/or succeeded, -as well as other essentially equivalent rights anywhere in the world. - -k. You means the individual or entity exercising the Licensed Rights under -this Public License. Your has a corresponding meaning. - -Section 2 – Scope. - - a. License grant. - -1. Subject to the terms and conditions of this Public License, the Licensor -hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, -irrevocable license to exercise the Licensed Rights in the Licensed Material -to: - - A. reproduce and Share the Licensed Material, in whole or in part; and - - B. produce, reproduce, and Share Adapted Material. - -2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions -and Limitations apply to Your use, this Public License does not apply, and -You do not need to comply with its terms and conditions. - - 3. Term. The term of this Public License is specified in Section 6(a). - -4. Media and formats; technical modifications allowed. The Licensor authorizes -You to exercise the Licensed Rights in all media and formats whether now known -or hereafter created, and to make technical modifications necessary to do -so. The Licensor waives and/or agrees not to assert any right or authority -to forbid You from making technical modifications necessary to exercise the -Licensed Rights, including technical modifications necessary to circumvent -Effective Technological Measures. For purposes of this Public License, simply -making modifications authorized by this Section 2(a)(4) never produces Adapted -Material. - - 5. Downstream recipients. - -A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed -Material automatically receives an offer from the Licensor to exercise the -Licensed Rights under the terms and conditions of this Public License. - -B. No downstream restrictions. You may not offer or impose any additional -or different terms or conditions on, or apply any Effective Technological -Measures to, the Licensed Material if doing so restricts exercise of the Licensed -Rights by any recipient of the Licensed Material. - -6. No endorsement. Nothing in this Public License constitutes or may be construed -as permission to assert or imply that You are, or that Your use of the Licensed -Material is, connected with, or sponsored, endorsed, or granted official status -by, the Licensor or others designated to receive attribution as provided in -Section 3(a)(1)(A)(i). - - b. Other rights. - -1. Moral rights, such as the right of integrity, are not licensed under this -Public License, nor are publicity, privacy, and/or other similar personality -rights; however, to the extent possible, the Licensor waives and/or agrees -not to assert any such rights held by the Licensor to the limited extent necessary -to allow You to exercise the Licensed Rights, but not otherwise. - -2. Patent and trademark rights are not licensed under this Public License. - -3. To the extent possible, the Licensor waives any right to collect royalties -from You for the exercise of the Licensed Rights, whether directly or through -a collecting society under any voluntary or waivable statutory or compulsory -licensing scheme. In all other cases the Licensor expressly reserves any right -to collect such royalties. - -Section 3 – License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the following -conditions. - - a. Attribution. - -1. If You Share the Licensed Material (including in modified form), You must: - -A. retain the following if it is supplied by the Licensor with the Licensed -Material: - -i. identification of the creator(s) of the Licensed Material and any others -designated to receive attribution, in any reasonable manner requested by the -Licensor (including by pseudonym if designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of warranties; - -v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; - -B. indicate if You modified the Licensed Material and retain an indication -of any previous modifications; and - -C. indicate the Licensed Material is licensed under this Public License, and -include the text of, or the URI or hyperlink to, this Public License. - -2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner -based on the medium, means, and context in which You Share the Licensed Material. -For example, it may be reasonable to satisfy the conditions by providing a -URI or hyperlink to a resource that includes the required information. - -3. If requested by the Licensor, You must remove any of the information required -by Section 3(a)(1)(A) to the extent reasonably practicable. - -4. If You Share Adapted Material You produce, the Adapter's License You apply -must not prevent recipients of the Adapted Material from complying with this -Public License. - -Section 4 – Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that apply to -Your use of the Licensed Material: - -a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, -reuse, reproduce, and Share all or a substantial portion of the contents of -the database; - -b. if You include all or a substantial portion of the database contents in -a database in which You have Sui Generis Database Rights, then the database -in which You have Sui Generis Database Rights (but not its individual contents) -is Adapted Material; and - -c. You must comply with the conditions in Section 3(a) if You Share all or -a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not replace -Your obligations under this Public License where the Licensed Rights include -other Copyright and Similar Rights. - -Section 5 – Disclaimer of Warranties and Limitation of Liability. - -a. Unless otherwise separately undertaken by the Licensor, to the extent possible, -the Licensor offers the Licensed Material as-is and as-available, and makes -no representations or warranties of any kind concerning the Licensed Material, -whether express, implied, statutory, or other. This includes, without limitation, -warranties of title, merchantability, fitness for a particular purpose, non-infringement, -absence of latent or other defects, accuracy, or the presence or absence of -errors, whether or not known or discoverable. Where disclaimers of warranties -are not allowed in full or in part, this disclaimer may not apply to You. - -b. To the extent possible, in no event will the Licensor be liable to You -on any legal theory (including, without limitation, negligence) or otherwise -for any direct, special, indirect, incidental, consequential, punitive, exemplary, -or other losses, costs, expenses, or damages arising out of this Public License -or use of the Licensed Material, even if the Licensor has been advised of -the possibility of such losses, costs, expenses, or damages. Where a limitation -of liability is not allowed in full or in part, this limitation may not apply -to You. - -c. The disclaimer of warranties and limitation of liability provided above -shall be interpreted in a manner that, to the extent possible, most closely -approximates an absolute disclaimer and waiver of all liability. - -Section 6 – Term and Termination. - -a. This Public License applies for the term of the Copyright and Similar Rights -licensed here. However, if You fail to comply with this Public License, then -Your rights under this Public License terminate automatically. - -b. Where Your right to use the Licensed Material has terminated under Section -6(a), it reinstates: - -1. automatically as of the date the violation is cured, provided it is cured -within 30 days of Your discovery of the violation; or - - 2. upon express reinstatement by the Licensor. - -c. For the avoidance of doubt, this Section 6(b) does not affect any right -the Licensor may have to seek remedies for Your violations of this Public -License. - -d. For the avoidance of doubt, the Licensor may also offer the Licensed Material -under separate terms or conditions or stop distributing the Licensed Material -at any time; however, doing so will not terminate this Public License. - - e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. - -Section 7 – Other Terms and Conditions. - -a. The Licensor shall not be bound by any additional or different terms or -conditions communicated by You unless expressly agreed. - -b. Any arrangements, understandings, or agreements regarding the Licensed -Material not stated herein are separate from and independent of the terms -and conditions of this Public License. - -Section 8 – Interpretation. - -a. For the avoidance of doubt, this Public License does not, and shall not -be interpreted to, reduce, limit, restrict, or impose conditions on any use -of the Licensed Material that could lawfully be made without permission under -this Public License. - -b. To the extent possible, if any provision of this Public License is deemed -unenforceable, it shall be automatically reformed to the minimum extent necessary -to make it enforceable. If the provision cannot be reformed, it shall be severed -from this Public License without affecting the enforceability of the remaining -terms and conditions. - -c. No term or condition of this Public License will be waived and no failure -to comply consented to unless expressly agreed to by the Licensor. - -d. Nothing in this Public License constitutes or may be interpreted as a limitation -upon, or waiver of, any privileges and immunities that apply to the Licensor -or You, including from the legal processes of any jurisdiction or authority. - -Creative Commons is not a party to its public licenses. Notwithstanding, Creative -Commons may elect to apply one of its public licenses to material it publishes -and in those instances will be considered the "Licensor." The text of the -Creative Commons public licenses is dedicated to the public domain under the -CC0 Public Domain Dedication. Except for the limited purpose of indicating -that material is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at creativecommons.org/policies, -Creative Commons does not authorize the use of the trademark "Creative Commons" -or any other trademark or logo of Creative Commons without its prior written -consent including, without limitation, in connection with any unauthorized -modifications to any of its public licenses or any other arrangements, understandings, -or agreements concerning use of licensed material. For the avoidance of doubt, -this paragraph does not form part of the public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/MIT.txt b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/MIT.txt deleted file mode 100644 index 204b93da48..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/MIT.txt +++ /dev/null @@ -1,19 +0,0 @@ -MIT License Copyright (c) - -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 (including the next -paragraph) 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. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/Unlicense.txt b/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/Unlicense.txt deleted file mode 100644 index 24a8f90199..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/LICENSES/Unlicense.txt +++ /dev/null @@ -1,20 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or distribute -this software, either in source code form or as a compiled binary, for any -purpose, commercial or non-commercial, and by any means. - -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and -to the detriment of our heirs and successors. We intend this dedication to -be an overt act of relinquishment in perpetuity of all present and future -rights to this software under copyright law. - -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 -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. For more information, -please refer to diff --git a/frozen/Adafruit_CircuitPython_UC8151D/README.rst b/frozen/Adafruit_CircuitPython_UC8151D/README.rst deleted file mode 100644 index 08efe2f99b..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/README.rst +++ /dev/null @@ -1,149 +0,0 @@ -Introduction -============ - - -.. image:: https://readthedocs.org/projects/adafruit-circuitpython-uc8151d/badge/?version=latest - :target: https://docs.circuitpython.org/projects/uc8151d/en/latest/ - :alt: Documentation Status - - -.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg - :target: https://adafru.it/discord - :alt: Discord - - -.. image:: https://github.com/adafruit/Adafruit_CircuitPython_UC8151D/workflows/Build%20CI/badge.svg - :target: https://github.com/adafruit/Adafruit_CircuitPython_UC8151D/actions - :alt: Build Status - - -.. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - :alt: Code Style: Black - -CircuitPython `displayio` driver for US8151D-based ePaper displays - - -Dependencies -============= -This driver depends on: - -* `Adafruit CircuitPython `_ - -Please ensure all dependencies are available on the CircuitPython filesystem. -This is easily achieved by downloading -`the Adafruit library and driver bundle `_ -or individual libraries can be installed using -`circup `_. - -Adafruit 2.9" Flexible 296x128 Monochrome eInk / ePaper Display - -`Purchase one from the Adafruit shop `_ - - -Installing from PyPI -===================== - -On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from -PyPI `_. -To install for current user: - -.. code-block:: shell - - pip3 install adafruit-circuitpython-uc8151d - -To install system-wide (this may be required in some cases): - -.. code-block:: shell - - sudo pip3 install adafruit-circuitpython-uc8151d - -To install in a virtual environment in your current project: - -.. code-block:: shell - - mkdir project-name && cd project-name - python3 -m venv .venv - source .venv/bin/activate - pip3 install adafruit-circuitpython-uc8151d - - - -Installing to a Connected CircuitPython Device with Circup -========================================================== - -Make sure that you have ``circup`` installed in your Python environment. -Install it with the following command if necessary: - -.. code-block:: shell - - pip3 install circup - -With ``circup`` installed and your CircuitPython device connected use the -following command to install: - -.. code-block:: shell - - circup install uc8151d - -Or the following command to update an existing version: - -.. code-block:: shell - - circup update - -Usage Example -============= - -.. code-block:: python - - import time - import board - import displayio - import adafruit_uc8151d - - displayio.release_displays() - - # This pinout works on a Feather M4 and may need to be altered for other boards. - spi = board.SPI() # Uses SCK and MOSI - epd_cs = board.D9 - epd_dc = board.D10 - epd_reset = board.D5 - epd_busy = None - - display_bus = displayio.FourWire( - spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000 - ) - time.sleep(1) - - display = adafruit_uc8151d.UC8151D( - display_bus, width=296, height=128, rotation=90, busy_pin=epd_busy - ) - - g = displayio.Group() - - with open("/display-ruler.bmp", "rb") as f: - pic = displayio.OnDiskBitmap(f) - t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) - g.append(t) - - display.show(g) - - display.refresh() - - time.sleep(120) - - -Documentation -============= - -API documentation for this library can be found on `Read the Docs `_. - -For information on building library documentation, please check out `this guide `_. - -Contributing -============ - -Contributions are welcome! Please read our `Code of Conduct -`_ -before contributing to help this project stay welcoming. diff --git a/frozen/Adafruit_CircuitPython_UC8151D/README.rst.license b/frozen/Adafruit_CircuitPython_UC8151D/README.rst.license deleted file mode 100644 index 87eb036957..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/README.rst.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries -SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_UC8151D/adafruit_uc8151d.py b/frozen/Adafruit_CircuitPython_UC8151D/adafruit_uc8151d.py deleted file mode 100644 index 1055d3d562..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/adafruit_uc8151d.py +++ /dev/null @@ -1,132 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries -# -# SPDX-License-Identifier: MIT -""" -`adafruit_uc8151d` -================================================================================ - -CircuitPython `displayio` driver for US8151D-based ePaper displays - - -* Author(s): Melissa LeBlanc-Williams - -Implementation Notes --------------------- - -**Hardware:** - -* `Adafruit Flexible 2.9" Black and White `_ - -**Software and Dependencies:** - -* Adafruit CircuitPython firmware for the supported boards: - https://github.com/adafruit/circuitpython/releases - -""" - -import displayio - -__version__ = "0.0.0+auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_UC8151D.git" - -_START_SEQUENCE = ( - # b"\x01\x05\x03\x00\x2b\x2b\x09" # power setting - # b"\x06\x03\x17\x17\x17" # booster soft start - b"\x04\x80\xc8" # power on and wait 10 ms - b"\x00\x01\x1f" # panel setting. Further filled in below. - b"\x50\x01\x97" # CDI setting -) - -_GRAYSCALE_START_SEQUENCE = ( - b"\x04\x80\xc8" # Power on - b"\x00\x01\xbf" # Panel setting - b"\x50\x01\x97" # CDI setting - # Common voltage - b"\x20\x2a" - b"\x00\x0A\x00\x00\x00\x01" - b"\x60\x14\x14\x00\x00\x01" - b"\x00\x14\x00\x00\x00\x01" - b"\x00\x13\x0A\x01\x00\x01" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - # White to White - b"\x21\x2a" - b"\x40\x0A\x00\x00\x00\x01" - b"\x90\x14\x14\x00\x00\x01" - b"\x10\x14\x0A\x00\x00\x01" - b"\xA0\x13\x01\x00\x00\x01" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - # Black to White - b"\x22\x2a" - b"\x40\x0A\x00\x00\x00\x01" - b"\x90\x14\x14\x00\x00\x01" - b"\x00\x14\x0A\x00\x00\x01" - b"\x99\x0B\x04\x04\x01\x01" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - # White to Black - b"\x23\x2a" - b"\x40\x0A\x00\x00\x00\x01" - b"\x90\x14\x14\x00\x00\x01" - b"\x00\x14\x0A\x00\x00\x01" - b"\x99\x0C\x01\x03\x04\x01" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - # Black to Black - b"\x24\x2a" - b"\x80\x0A\x00\x00\x00\x01" - b"\x90\x14\x14\x00\x00\x01" - b"\x20\x14\x0A\x00\x00\x01" - b"\x50\x13\x01\x00\x00\x01" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" - b"\x00\x00\x00\x00\x00\x00" -) - - -_STOP_SEQUENCE = b"\x50\x01\xf7" b"\x07\x01\xA5" # CDI setting # Deep Sleep -# pylint: disable=too-few-public-methods -class UC8151D(displayio.EPaperDisplay): - r"""UC8151D driver - - :param bus: The data bus the display is on - :param \**kwargs: - See below - - :Keyword Arguments: - * *width* (``int``) -- - Display width - * *height* (``int``) -- - Display height - * *rotation* (``int``) -- - Display rotation - """ - - def __init__(self, bus: displayio.FourWire, **kwargs) -> None: - if kwargs.get("grayscale", False): - start_sequence = bytearray(_GRAYSCALE_START_SEQUENCE) - else: - start_sequence = bytearray(_START_SEQUENCE) - width = kwargs["width"] - height = kwargs["height"] - if "rotation" in kwargs and kwargs["rotation"] % 180 != 0: - width, height = height, width - - super().__init__( - bus, - start_sequence, - _STOP_SEQUENCE, - **kwargs, - ram_width=128, - ram_height=296, - busy_state=False, - write_black_ram_command=0x13, - write_color_ram_command=0x10, - refresh_display_command=0x12, - ) diff --git a/frozen/Adafruit_CircuitPython_UC8151D/docs/_static/favicon.ico b/frozen/Adafruit_CircuitPython_UC8151D/docs/_static/favicon.ico deleted file mode 100644 index 5aca98376a1f7e593ebd9cf41a808512c2135635..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4414 zcmd^BX;4#F6n=SG-XmlONeGrD5E6J{RVh+e928U#MG!$jWvO+UsvWh`x&VqGNx*en zx=qox7Dqv{kPwo%fZC$dDwVpRtz{HzTkSs8QhG0)%Y=-3@Kt!4ag|JcIo?$-F|?bXVS9UDUyev>MVZQ(H8K4#;BQW-t2CPorj8^KJrMX}QK zp+e<;4ldpXz~=)2GxNy811&)gt-}Q*yVQpsxr@VMoA##{)$1~=bZ1MmjeFw?uT(`8 z^g=09<=zW%r%buwN%iHtuKSg|+r7HkT0PYN*_u9k1;^Ss-Z!RBfJ?Un4w(awqp2b3 z%+myoFis_lTlCrGx2z$0BQdh+7?!JK#9K9@Z!VrG zNj6gK5r(b4?YDOLw|DPRoN7bdP{(>GEG41YcN~4r_SUHU2hgVtUwZG@s%edC;k7Sn zC)RvEnlq~raE2mY2ko64^m1KQL}3riixh?#J{o)IT+K-RdHae2eRX91-+g!y`8^># z-zI0ir>P%Xon)!@xp-BK2bDYUB9k613NRrY6%lVjbFcQc*pRqiK~8xtkNPLxt}e?&QsTB}^!39t_%Qb)~Ukn0O%iC;zt z<&A-y;3h++)>c1br`5VFM~5(83!HKx$L+my8sW_c#@x*|*vB1yU)_dt3vH;2hqPWx zAl^6@?ipx&U7pf`a*>Yq6C85nb+B=Fnn+(id$W#WB^uHAcZVG`qg;rWB}ubvi(Y>D z$ei>REw$#xp0SHAd^|1hq&9HJ=jKK8^zTH~nk)G?yUcmTh9vUM6Y0LMw4(gYVY$D$ zGl&WY&H<)BbJ&3sYbKjx1j^=3-0Q#f^}(aP1?8^`&FUWMp|rmtpK)bLQ1Zo?^s4jqK=Lfg*9&geMGVQ z#^-*!V`fG@;H&{M9S8%+;|h&Qrxym0Ar>WT4BCVLR8cGXF=JmEYN(sNT(9vl+S|%g z8r7nXQ(95i^`=+XHo|){$vf2$?=`F$^&wFlYXyXg$B{a>$-Fp+V}+D;9k=~Xl~?C4 zAB-;RKXdUzBJE{V&d&%R>aEfFe;vxqI$0@hwVM}gFeQR@j}a>DDxR+n+-*6|_)k%% z*mSpDV|=5I9!&VC&9tD%fcVygWZV!iIo2qFtm#!*(s|@ZT33*Ad;+<|3^+yrp*;oH zBSYLV(H1zTU?2WjrCQoQW)Z>J2a=dTriuvezBmu16`tM2fm7Q@d4^iqII-xFpwHGI zn9CL}QE*1vdj2PX{PIuqOe5dracsciH6OlAZATvE8rj6ykqdIjal2 z0S0S~PwHb-5?OQ-tU-^KTG@XNrEVSvo|HIP?H;7ZhYeZkhSqh-{reE!5di;1zk$#Y zCe7rOnlzFYJ6Z#Hm$GoidKB=2HBCwm`BbZVeZY4ukmG%1uz7p2URs6c9j-Gjj^oQV zsdDb3@k2e`C$1I5ML5U0Qs0C1GAp^?!*`=|Nm(vWz3j*j*8ucum2;r0^-6Aca=Gv) zc%}&;!+_*S2tlnnJnz0EKeRmw-Y!@9ob!XQBwiv}^u9MkaXHvM=!<3YX;+2#5Cj5pp?FEK750S3BgeSDtaE^ zXUM@xoV6yBFKfzvY20V&Lr0yC - -.. toctree:: - :caption: Related Products - -Adafruit 2.9" Flexible 296x128 Monochrome eInk / ePaper Display - -.. toctree:: - :caption: Other Links - - Download from GitHub - Download Library Bundle - CircuitPython Reference Documentation - CircuitPython Support Forum - Discord Chat - Adafruit Learning System - Adafruit Blog - Adafruit Store - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst.license b/frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst.license deleted file mode 100644 index 52de478909..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/docs/index.rst.license +++ /dev/null @@ -1,4 +0,0 @@ -SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries - -SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_UC8151D/docs/requirements.txt b/frozen/Adafruit_CircuitPython_UC8151D/docs/requirements.txt deleted file mode 100644 index 88e67331eb..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/docs/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -sphinx>=4.0.0 diff --git a/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp b/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp deleted file mode 100644 index 726b5e026fd30b7e5baf5c23323d159b0eb5f65d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360122 zcmeI5J<>PHa@9vfU}y)p3NQ(_AVLn79IXQnhrqzWkgEj{fdQ^IAh~k216($MfjgY% z$@}EwoAuGByQ``{{-@)Ad$O}nW@Y`VDsR7YN29;`>woyK|MIu5>%ZVX{}KQByFdHw zw||TO{Mm2+>dXDxzsLK3{qKJJ{?E4qx4-%ifAgPyZ1%7JA_;#dE)Q`n<8kq849xm9 zbD2F6vEm7f70+r@8DW~ucsA2MQ4lBo#QIm(ELJ>ivEo_nQX1HZx8>QD_9@~x@u$>$ zRh?qRlNT$V)h?xXCnwzU>`MC-vCsM`1z%XFSn=@1if2VCfz+v*(Z7>vpCxkw&no+p zYQ>7jE>=9NUCP*_5QxW?XII*%h;6b@srK4B#fs-IRy?asWrS%qIo2tat)a&LE&O z$Ws+7vEm6xIfH=CAWv1S#EK^%vyzf0pnWA)JON&*eZ{kqk|&^jC00BEUa5V>vyzf0pnWA)JON&* zeZ{kqk|&^j^-xxS^S}QyepWn;KmUJ!%)|YExRzVmSId!q#DLmY{4!t8%KFm({O|v! z^Ml5I{Jdr;FK0DlQp$Nb0qrY(2`*t}A4|A*dQ|z!qVUmW20zD9%1c;{DqeYROF;XI zUz$r;9qU)#o$(0R%)DD(XOfBzQ0)?4+fauILnv445H z{=sc#X|6hhOl^15T*9hsRs=OWdffS$o>wkrb-rL_cmx6MD}I?)va%-Q%?ka;`jWLK`0dfUmUX9Oe>JF| zZ!^or&-A=RTXu|vhM(+7q0tE4ro&{gbL?N@Nx&wG&@{a5<);I6fn z_?`sToWXm}eQ#B3SXs0BYA?n26$<_z|LuSM{a=3nD`9_q`_-&|{~fO&fZ{%%P-3Vx3@hh^16*>$`Lcc<9iEYO_5}H!{8}Htc;KZwHH?tmScYeNS zlxtX>sqj9rU}e{RO1f<&0Cn5i?pD|uR`v;meuZD`SJua@BYpL&Uq7Po82eQU{Q6q^ zzAX8l9%lY!4Xc?mQ0_Yt(7xhVWeqF)vO;62_AC5x&pxic%KrHyp?!Mcj#t$`4_Zz% zG4(5cxuv`zfi-9Fh7&(f(i&E=U!lGDmy$Q7*rx1l^tj9et@Yt<#({|+2wB7GKw%1b zGy&}^e)*QMvfg6%KXs(aUoHEra+r%*`M5IPO+fpKU*E;7ykFr@cFd<#sX-tALzq}(^vu1@1c*Re1h;lKjAvIr>#Q**6Zd_H#{m0e5;@4;~EA$!E=3OhbBY%V-_NC~z zSR_%u;#XP9I}=!Z2Jehwv$n;otY4uj>qy>+lHtt?Mto&{yKhcyxL`4>;q@!wJqc)E z@$0gfmG!IGc49j++rFUeZc5kS5tsTEzrIr5pTOcXcz+A8%7;z>gnn?@MODV<8AP4L`?G%Ehck zm90ECC!l@BFVI!2tmk+y@~)NIl*>$jx46`=`1O_Y{sgW%gZC#>R(KUF>p6D!W`)PH zU-_4n8JGfOEu41)dY8v7~0@_zR{0mumck+Ja&B|X{Yk~l;@PolmZMgD6R>S9_ zg!dt!eZ{ZEg{-V8`9H*NkKVE{1$fM9UsmxIKf!^@3t0`Eg;L#(fc6!?A{Vlhuq% z)UV+8Hf4H#Qj?UIu$nX%rM(XU?JIsQE@$Qa3N>4U!X38tE1O8P`Kb+8Ue0RxjFj*W z1hlXCRk#nU`1h}@ersH?V^8C!He7ihR>P;JgclOfzT)BEjg@~&xxvq6w(@SQX3tmo z*AURY;yK@qm48av-?Q>hEPh7wly_q_Z>Gw;l7RLVPy24Hyg~W@I0%EE&Q#^ySWTU* zk}o5meZ`}`Eh{uG`_@vw;#c!NO8slw`L($18RVz1OnF;Y{-L!D#pXb_Wwlwk1a~H& zeZ{ZNJz3qbSpn%iS@CNv7^Zij`RL1f-lnKxdGrDpq2}6OeKS0i8jfs#u8?Pe95U1at;@s$wNpJOL?Z z5YQRqsfv|Y@dS7!_LW_H$j2%H>SO1=cj98j6B8?*m6SXI?JKe33GhnoE1s2DnZqeYJ_m1!CnWHVv`bL?poh0@_zRG_evZo`94y2Io2tat)a&LE&O z$Ws+7vEm6xIfH=CAWv1S#EK^%e)zyyADgmR9pl!DN<8DE*`=qIO8yTa5VypKO!@FM#p*D+R$xS0+NGzJ zNB$2X5VypKO!@FM#p*D+PM}kT5p9H&o=zUU`UC>LLq1`$C+8?uCjqv?4J>nSWsv_v z2wx|6>xH3JJ!swWbN zTjGiJudG?D#?l5)yFBfWe)zyyADgmR9pk1b5g0{4XOJf;R(n`| z{ma|+Uxqv}DH#GfgA66ph!xLDN)ebrKxdGrDpouzDMerg0i8jfs#x)?q!fV}1at;@ zs$#{nl2Qa_5YQRqsfrcPN=gx!K|p7arz%!FD=9@_1_7Nxo~l^!tfUly83Z1522tv@ z)m}ULjMZ085qK7X2c5yMZguHDfOzfb&)Qe2Rs?1cc+eUA>Q?GkGd975oVHlkuGfTV zDdoik9<-zE2wcePL98yMq@hJ%9)ZixAm4>}Vz--USPB>0!Jnlvw^6@jM^xcm(AU5Hmsf`2)yN%K-#5qJuL%g-R+ zg?Qy8_?NSqG%uwUfu|6-{0#D4h*wU6e>tm3^HN$7cnX2b&miB0c;zJcm$RBQFQpZM zrx3XO4DwxwS5AU|Ijc$YQd$vs3W3YdAm4>}Sr?ZN+#O@&E>2P)T|JOfNibn-NUPIJ5CGi2wJa>1y-ZHcsJ6Z?oURNZ9ZCfl2x5i zlLloT5zfd?YGRR7?UQx(!`HCt*Pyp!32g30A8u2b1QwW_%;T}ZYLpl6Mk>Jl$w;!z zM+;A~sxxZRpv)t}8QEb?EU$0><3Ij>@@M%Em%14^o7H9k5{xC#-;ilLmEu@T>ut;L zu`NN%Z-K41$?v1Mu_@^1@4u}kuR6V+y#})F4cVnn)!J~S6P}aJ3gMO(#-z)NpOjo_ zc>?AB;bUD{CaHR&{xAOGYmeF8{cgm!ug>u9Ne{A- z$^$YaPnRc2{`1YsG9az`l|z23kv30!B&Qrh`nD%bGWWYt6;z!bVn$U{b;iJ|pz7R= zih@o_QC1y@cg9q^Yz(nWze}9zx3PT0_*VUD7uXLM$DPx%JBV5#Rln!K+x}Na^=*ps zY|*G{QZ{H}2y7-Qg|wndSsJ|*@S|6iWkS+Zav%d48Is2fA^vFL{y3yxSvGxNF-!Ak zjc=PxqnxINr1J=8%i|eZf|lO`(_7CLjjE2qg-JgtOd8$$5h^c_qqtCP@IO#`zyO8I{Y-XbGNOmHQ~jPWg+o?);7t0I%^o|Nl+%^1%t>Dk=NU{{3e0mX zPc@1hu~kX(V~FG#{)i!L6f@%8T9A1*$1MX>2ZKQUY7^r-1aUKvHYQFgqm0K@J(x%p z{nc!YrVOk`#j#+QS2e1X9m`XVB1bH1sCtmC>L2LD5b3f$b8-meEc?~Toc(Z&*ca&S zG6GnObUJ2uc18-zRiiM3 zU&FtDklDJH4N)y%loLaYN~JvK3HYX(XT&0L?&2@LGCRJ7U3I$O!&8(ClHc`iR0UP1 zhrmbzdyE3JlZ+HpqpHp_A?aCg27NmXZ&o%(+`NZJd|Acn9@{fb-^$ru7Z+v?O`F;FW$ z)qr!i>u2G+LQH%ta5HLC&>7ug<2}u*n!M_afiWRzW3fo(VOeWG6n^ZSgFk&=9bTPB z2Vx6h{~x~F+*=t+GV!eS?HIeMOahNh{>~#4Vw#i$&eGFz`Y0^{lPYRrLej=slgh)g zqA%4Q=s72U$UEs1&gQ;=)nUk=8Cc&*KVC5TF)M#{VwHF8LlKW#%l6D}^p)wYN5M$1 zs*j}JWGO@GEIkM*ugyFjm6Y+ZOuOm9Vr^>92&$W*>O9%35RSC!S7#RMiLu!KSoiAP zr_*^`jrG7aMm)l>&s+mjohc*6jx7o66_XFQk)OPV^ec=tuVo?ma6U?Sl0biV#pF=p z?AYD??ul>RcG*;8;E5iXYSfg+mV~7lRalt^$;pdvR;ai7Lk1g5{i0t>yHtVg{Vi6CcTD1zGA>RzIAU0go^yT{hOFrwq`#^QcXPMj2Mtpj&MbSCz5Am3r8SgCns#O`DRMGwaH zNA;_DtMKm3*g^-|l{PXL>z+Jf94!x?2?(|H>Ql0B6G z7I$8LZ%1a71Gzx`s)Qp?hX8g?r-9&Yj7>_sN*+9(`NgqhPbH96cI;T*j?5^NyFmS_ zgdto4SKmZFmZxketS2>WsRlh3XJlf+cJA4+%Og0n9 z%AeO$zS`^YR5F$k!0OK%%QvkV6Bc8O8{A31&pCqvN6R6b30?N0Wo)|8BJ%Oob(A&|b zvA17YkBWEotM!{_{fO8|XelS}UN)J>^)fCefF+w(1Co;$->>>g3N&(s`*W6&wp8Y24Ha;%j))KUvyE6lg_Z#E)QfXwPw z*Y2oEqhn?LD~PnMl3h`gidWiE1hDj@Qk8j-JYB9yezF~H%8*w5$|1kWIQ*G(IPgvM zUNaXQ@Og7dP07YGCkBmgHyaTtKu-0mc?)`N=FKmqYI&WgvXxac$axIZOSawyy;BJ{JymKuR;6WVQOVxYI*KZt!n5Hzya^PJ^3njBukY%{M>a})^l{BewxdlMvZ-I4-xcr6P`0M3 z=Y11@*^Inz%$S$;A{)Z(Xkbu#+-yXo0NK>9W-R5?b5^@kaz1^IpHM#z_`GR)Yr+t2 zC&ONm?PybmQV90M&E2iqyU-KujVc2qcfKc zDtR6~yALVeTgr_2TJqSPsy2ou+tH>B`PHvxEaf|LrUn%s-!Z}0&%#>Dq-k36YL80J z%|=8DkXHR_(rUgVZR}Cee#h)yKMQLqlct%PQs-m-36 zp$aPr%szw2j|SqqceXLFSpnT_R^{r*GnIh;FgO+OjO03lJXNvcSxG4ZGYIGm@>Io& zXCIo&XCHklHIv&V)N@*Z}iVZ=w{0M9NUK7<>)!Vie|R(N2D*Mx}G@TH7MZO_{f<}W?N3wU2bgI4`s!mHG; zj580xlKb7W?ajlFn3T%~O5;B9QLKiqT10Ag|318cHzfo*T;4-qR3Gr>Bqqb>XvFGs*7^}Mwf^8;0xiOAvVQ38YU%N|^~yVv8z#0gU?+bo&n|zbo?Ur9 zK`d7MDr1}5j}MV@F9GWbsWYHUFc+fi>We#?p9J}@NC=muwU*_N{jr$015+`>m6{SS z<0M6mM2lP2O^r`CH0KeoQA_ zj3c`V$V7Samz3ocC z#3=FQtVT^ldEP_-+tMzZl-awE%uj;mUrSt&#!h86oKcw`A-$E4vnqr6G*K5AtpDNr^{qIA+8<-j;;R4CaZ-YG4!`uxI4lRR+_YO3khz zMu{(HHEJTt^Hu_7(?~Nl0q!_cc2BJ-KAH_#N@9;mX_;NwigLj*V^Uha7|c3dj3us(zF+RX8dwp9gb{mvczY_;{6l zIjgHCu5q75AoUr0^pj-mE2?8{kQHSrna z+TM;kobjNNxC+tsB0G6pV}>c+nX-AFD2O4Zk9SvIZg}x#*s+40j@xFPHoGLVJbqMR zxXg_dGU{=5{>?fQK!*?mlP11eX4|!?Tb}Z5 ztmh6kDzsx2r@#~jeKo}V)jN~+jHX)8nS^^|Q!i4#+6(ZB`nc=NW;{02QW*)f-bR0! zCuV59jTy`??`57lc&yHJ&{~B-9IvX(52+cZuPTQ-G1l;$yAmdhjv^*Wn)qs^eL1U@ zlbt$Ch2@EJ2mAEsy!*+cMi7JgBf* zr1@K~%F1K2vO`^J=6R}h&KOSpY6jKY=EP^a{aO{4$HYCpC*9*olE;+MX&%$NZ30gM zBZfqOv`bC$_#=!Mcw0Lb>~^c#)}&&;vLvkxGyJWphL5FwH5}<%6ZZFH|1HmCR33iB zXDO?E;7t8$@uaF%&8R{BY6jI;=G@$q5Nv7^nNnYRQpkrtR{6l0uEmrv`kE2duhwwZ zC{+T>_IY*m$2qMjRm=A8tB$4`IK;VZ9o4Ufte29AzyboTUgXWnj`M;_(h%xb2}tL0 z8LLhWdL;r22(-4k_p4Szn_XM0u;Js9-&a1a0olAG?Xqhbt7S9NKq62jP~GZq#(q@| zob9X@He=AuepMY5<@GQ1t134+Mc^<2oVaRiI*C=yY-g*s;p6uERcE+FDLtxRbIpb&_G<|ajI}pp+0dPSwOMoOQSnjzYLlJ>BCv}8I^`Y6)(OF6eGd;b)UP_s^-2Wx64-1An}WR~?$R$C zUHxj;x=1Vn>j^O3fYHpWeA(#gSMwH8nMGg-fz58PDHu{lC&{t`)UP_LpjRSr2LhYj zU{f%A7Rw4?`c;}NYTLY!cG-numW`!>S_FJcv;^`WCa}4~Hw74a>XBp$I6VCrxY@6w z*lpjOEn_MiFT;#wtkSr8tP;?2RI!|KZX(?jV00YGd8d*o;0yte?e{B};SJWw!k8@!{NKQFeE+%V3x?dSrJ9M3ODpre^ke+$^9~`Cfmg zUwJBTR(#8v&Btqlv5Zw5^sRP;X?FC)Sx0|qmmZ6a{+La6ivUTiFPnWH`=hs}cEGQG zbpYCnL*m9WJ9^^8qrbFEkHtoR%qF`?dHfNEYiv2vqbc1P17&vz7|f1gog=K|5O2|{SK!c8+cVcWKSSvqnRxFVpqQ!yKu^OhCsDndBXl% zmn}2a*MnZvX-ECHQ?Yca8auA~)mWY{$X0$oBv196CJi{a$Mx<>l+0fZX*u0*2JUvX z#&SPoE!$psF-d9pqbBC@w+jsGOV#^=(W^tKUsbVGoy%BNM}L_!o6gmVQz}bO z8C80YMV-&nAJ^V~?0wl8)c4iL?y>5`dfqOTrN>5(_fiu*{c2;L544w^ zL499+;O^>7IiApt9bX|^d^EfC*r3s0dg5C?4--{tN(iL}p6IO3w9NB?9`!4J(U-B} zOM0}@4rx56>Dbz0#)_sAw~> z(hMiC>R0^QEn~%(B&7&^6oF-DP~TS{wXZZ;5tu<> zS-+Z5{NkKqwHUaD6M;lPXD|WjJc?BZj$Vnt0s=aNJY=!rSxG4ZGYIGm@>Io&XSJ!s z|9%Ia?fdu3pW9|O2|k3t*N)M}5fCem6Q%lTMa{p)EFvFie6p>bz^}eo?P6t}s1;&w zz42NKbP28Q%A$nlD|I>`fL9EEt_YK3)<8!8L>9Li^iivk$M-Q>L$NZjT zuhAd0^>*(lFVII6m`;2&J9*;c3#QLcAx^wXrlc1`_<>%gBw3xAHHP@UsE;dOCWQE) zqij#O*XS3}db@X&cj#L*%%9%I$9GKsz$~g{kSD@{9Ul*j^4t)cyWdMPRnM{c`X~%- z)5NFf;VYc1lPTRE*-)ZdjM_lMee>l%rUL=yV>@)c-Hcg`(sPvp4^obct z4x64Rc;b`~*BmEq_NFHa4v+ijKoBqpcDK1yJ!m!d^Z9;7eqZj1#?Q-N{u%|lY-FkG zqrYWW1NS;(a>U}%F3`uwQ?hcszjBXf za1V@_E!t7T+tnfX@Wsk!Rl68Y8cwVdkj|r6b>Q@0MRd{jC^+ph4{U$+dgG%edvZ0! ziU%lGJgcMxI;ZDGRr4+Upk@UKEg*@H9>r?c9?-tpg)52;UA)J)%j|o8wP|1R8$hg{ z&g!0LFj4hw2E*;7S@3vIRu=;4Fc+&1ob*bp5|Ga0Jz1rK;fsEF-`VbjzY{`uF<8>goHcUw?mn`{!4&k*!$$ zN+UjHTdX1xouglAV0Sb>8`^Kaa&!W}-^OvWt=LFJoPVX!+>nro)rYg{v<~f!58oSc T`pMSbh(J1r2r{u6#p?e9C4JK7 diff --git a/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp.license b/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp.license deleted file mode 100644 index a784acfa32..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/examples/display-ruler.bmp.license +++ /dev/null @@ -1,2 +0,0 @@ -# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries -# SPDX-License-Identifier: MIT diff --git a/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_grayscale_test.py b/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_grayscale_test.py deleted file mode 100644 index 71b8316a87..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_grayscale_test.py +++ /dev/null @@ -1,68 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Martin Refseth, written for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -"""Simple test script for 1.54" 152x152 grayscale display. - -Supported products: - * 1.54" Grayscale Display (GDEW0154T8D) - """ -# pylint: disable=no-member - -import time -import board -import displayio -import busio -import adafruit_uc8151d - -displayio.release_displays() - -# Pinout intended for use with a Raspberry Pi Pico -clk = board.GP10 -si = board.GP11 -dc = board.GP8 -cs = board.GP9 -rst = board.GP12 -busy = board.GP13 - -display_bus = displayio.FourWire( - busio.SPI(clk, si), command=dc, chip_select=cs, reset=rst, baudrate=1000000 -) - -time.sleep(1) - -display = adafruit_uc8151d.UC8151D( - display_bus, width=152, height=152, busy_pin=busy, rotation=180, grayscale=True -) - - -bitmap = displayio.Bitmap(152, 152, 4) - -# Draw Black -for x in range(0, 152): - for y in range(0, 38): - bitmap[x, y] = 0 -# Draw Dark Gray -for x in range(0, 152): - for y in range(38, 76): - bitmap[x, y] = 1 -# Draw Light Gray -for x in range(0, 152): - for y in range(76, 114): - bitmap[x, y] = 2 -# Draw White -for x in range(0, 152): - for y in range(114, 152): - bitmap[x, y] = 3 - -palette = displayio.Palette(4) -palette[0] = 0x000000 # Black -palette[1] = 0x404040 # Dark Gray -palette[2] = 0x808080 # Light Gray -palette[3] = 0xFFFFFF # White - -g = displayio.Group() -t = displayio.TileGrid(bitmap, pixel_shader=palette) -g.append(t) -display.show(g) -display.refresh() diff --git a/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_simpletest.py b/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_simpletest.py deleted file mode 100644 index a6a068fc2d..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/examples/uc8151d_simpletest.py +++ /dev/null @@ -1,48 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -"""Simple test script for 2.9" 296x128 monochrome display. - -Supported products: - * Adafruit Flexible 2.9" Monochrome - * https://www.adafruit.com/product/4262 - """ -# pylint: disable=no-member - -import time -import board -import displayio -import adafruit_uc8151d - -displayio.release_displays() - -# This pinout works on a Feather M4 and may need to be altered for other boards. -spi = board.SPI() # Uses SCK and MOSI -epd_cs = board.D9 -epd_dc = board.D10 -epd_reset = board.D5 -epd_busy = None - -display_bus = displayio.FourWire( - spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000 -) -time.sleep(1) - -display = adafruit_uc8151d.UC8151D( - display_bus, width=296, height=128, rotation=90, busy_pin=epd_busy -) - -g = displayio.Group() - -with open("/display-ruler.bmp", "rb") as f: - pic = displayio.OnDiskBitmap(f) - t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader) - g.append(t) - - display.show(g) - - display.refresh() - - time.sleep(120) diff --git a/frozen/Adafruit_CircuitPython_UC8151D/optional_requirements.txt b/frozen/Adafruit_CircuitPython_UC8151D/optional_requirements.txt deleted file mode 100644 index d4e27c4d74..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/optional_requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense diff --git a/frozen/Adafruit_CircuitPython_UC8151D/pyproject.toml b/frozen/Adafruit_CircuitPython_UC8151D/pyproject.toml deleted file mode 100644 index 4c3129c59f..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/pyproject.toml +++ /dev/null @@ -1,50 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -[build-system] -requires = [ - "setuptools", - "wheel", - "setuptools-scm", -] - -[project] -name = "adafruit-circuitpython-uc8151d" -description = "CircuitPython `displayio` driver for US8151D-based ePaper displays" -version = "0.0.0+auto.0" -readme = "README.rst" -authors = [ - {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} -] -urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_UC8151D.git"} -keywords = [ - "adafruit", - "blinka", - "circuitpython", - "micropython", - "uc8151d", - "uc8151", - "us8151d", - "displayio", - "epd", - "epaper", - "flexible", -] -license = {text = "MIT"} -classifiers = [ - "Intended Audience :: Developers", - "Topic :: Software Development :: Libraries", - "Topic :: Software Development :: Embedded Systems", - "Topic :: System :: Hardware", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", -] -dynamic = ["dependencies", "optional-dependencies"] - -[tool.setuptools] -py-modules = ["adafruit_uc8151d"] - -[tool.setuptools.dynamic] -dependencies = {file = ["requirements.txt"]} -optional-dependencies = {optional = {file = ["optional_requirements.txt"]}} diff --git a/frozen/Adafruit_CircuitPython_UC8151D/requirements.txt b/frozen/Adafruit_CircuitPython_UC8151D/requirements.txt deleted file mode 100644 index 274b851a2d..0000000000 --- a/frozen/Adafruit_CircuitPython_UC8151D/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -Adafruit-Blinka -adafruit-blinka-displayio From 92803a5d5834fe371036ff59a7775ea18d0d1826 Mon Sep 17 00:00:00 2001 From: Rose Hooper Date: Mon, 31 Oct 2022 20:46:18 -0400 Subject: [PATCH 033/357] Add note about rust to BUILDING.md --- BUILDING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BUILDING.md b/BUILDING.md index 37800e689f..4793824cf1 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -35,6 +35,8 @@ Failing to install these will prevent from properly building. pip3 install -r requirements-dev.txt +If you run into an error installing minify_html, you may need to install `rust`. + ### mpy-cross As part of the build process, mpy-cross is needed to compile .py files into .mpy files. From dec128f508a5c1a3ce4050b43838366a6b6f74c1 Mon Sep 17 00:00:00 2001 From: Rose Hooper Date: Mon, 31 Oct 2022 23:57:59 -0400 Subject: [PATCH 034/357] add boards list to make error message --- ports/atmel-samd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 4405766d00..d82c5faabc 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -24,7 +24,7 @@ # Select the board to build for. ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(error You must provide a BOARD parameter: $(basename $(wildcard boards/*))) else ifeq ($(wildcard boards/$(BOARD)/.),) $(error Invalid BOARD specified) From 36c4cc7d303e1700c684e80d290ca9ec275e38fe Mon Sep 17 00:00:00 2001 From: Rose Hooper Date: Tue, 1 Nov 2022 00:18:46 -0400 Subject: [PATCH 035/357] fix output layout of board list --- ports/atmel-samd/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index d82c5faabc..fce68d4d41 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -23,8 +23,15 @@ # THE SOFTWARE. # Select the board to build for. +define boardlist + +$(foreach dir,$(filter-out %.*,$(wildcard boards/*)),$(notdir $(dir))) + + +endef + ifeq ($(BOARD),) - $(error You must provide a BOARD parameter: $(basename $(wildcard boards/*))) + $(error You must provide a BOARD parameter: $(boardlist)Rerun with $(MAKE) BOARD=) else ifeq ($(wildcard boards/$(BOARD)/.),) $(error Invalid BOARD specified) From 8933f93439b10a7402f2c962bd5742b7902f1e38 Mon Sep 17 00:00:00 2001 From: Rose Hooper Date: Tue, 1 Nov 2022 11:00:48 -0400 Subject: [PATCH 036/357] simplify and use columns for boardlist --- ports/atmel-samd/Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index fce68d4d41..d27a048399 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -23,18 +23,20 @@ # THE SOFTWARE. # Select the board to build for. -define boardlist - -$(foreach dir,$(filter-out %.*,$(wildcard boards/*)),$(notdir $(dir))) - - +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) endef ifeq ($(BOARD),) - $(error You must provide a BOARD parameter: $(boardlist)Rerun with $(MAKE) BOARD=) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif From 52de6e855975c0c50164563fc006847ba05eb176 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 1 Nov 2022 08:37:06 +0000 Subject: [PATCH 037/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (1003 of 1003 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 9aea2605f2..23c301996b 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-10-29 22:00+0000\n" +"PO-Revision-Date: 2022-11-02 09:33+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -608,7 +608,7 @@ msgstr "Ambos os RX e TX são necessários para o controle do fluxo" #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "Both buttons were pressed at start up.\n" -msgstr "" +msgstr "Ambos os botões foram pressionados na inicialização.\n" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -678,7 +678,7 @@ msgstr "O pino bus %d já está em uso" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "Button A was pressed at start up.\n" -msgstr "" +msgstr "O botão A foi pressionado na inicialização.\n" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -2045,7 +2045,7 @@ msgstr "A leitura da temperatura expirou" #: supervisor/shared/safe_mode.c msgid "The BOOT button was pressed at start up.\n" -msgstr "" +msgstr "O botão BOOT foi pressionado na inicialização.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2058,11 +2058,11 @@ msgstr "" #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "The SW38 button was pressed at start up.\n" -msgstr "" +msgstr "O botão SW38 foi pressionado na inicialização.\n" #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "The VOLUME button was pressed at start up.\n" -msgstr "" +msgstr "O botão VOLUME foi pressionado na inicialização.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2074,11 +2074,11 @@ msgstr "" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" -msgstr "" +msgstr "O botão central foi pressionado na inicialização.\n" #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "The left button was pressed at start up.\n" -msgstr "" +msgstr "O botão esquerdo foi pressionado na inicialização.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" @@ -2149,7 +2149,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without requesting safe mode." -msgstr "" +msgstr "Para sair, reinicie a placa sem solicitar o modo de segurança." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" From d6fe37845672475e62cf73ca059bb69e95784dab Mon Sep 17 00:00:00 2001 From: dronecz Date: Wed, 2 Nov 2022 22:05:39 +0100 Subject: [PATCH 038/357] Update mpconfigboard.h --- ports/espressif/boards/maker_badge/mpconfigboard.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/espressif/boards/maker_badge/mpconfigboard.h b/ports/espressif/boards/maker_badge/mpconfigboard.h index 3c4a993364..18f98a693b 100644 --- a/ports/espressif/boards/maker_badge/mpconfigboard.h +++ b/ports/espressif/boards/maker_badge/mpconfigboard.h @@ -34,8 +34,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") - #define AUTORESET_DELAY_MS 500 #define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) From 71b5e6088b525e099bf6fb67922be7c06665d73a Mon Sep 17 00:00:00 2001 From: dronecz Date: Wed, 2 Nov 2022 22:07:28 +0100 Subject: [PATCH 039/357] Update mpconfigboard.mk --- ports/espressif/boards/maker_badge/mpconfigboard.mk | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ports/espressif/boards/maker_badge/mpconfigboard.mk b/ports/espressif/boards/maker_badge/mpconfigboard.mk index 6faba2aed3..bb96550da0 100644 --- a/ports/espressif/boards/maker_badge/mpconfigboard.mk +++ b/ports/espressif/boards/maker_badge/mpconfigboard.mk @@ -3,15 +3,6 @@ USB_PID = 0x2030 USB_PRODUCT = "Maker badge" USB_MANUFACTURER = "Czech maker" -IDF_TARGET = esp32s2 - -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_ESP32_CAMERA = 0 CIRCUITPY_ESP_FLASH_MODE=dio From 882100a87a9fdb9df78f4132b9453c427a0a4303 Mon Sep 17 00:00:00 2001 From: dronecz Date: Wed, 2 Nov 2022 22:10:44 +0100 Subject: [PATCH 040/357] Create sdkonfig --- ports/espressif/boards/maker_badge/sdkonfig | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ports/espressif/boards/maker_badge/sdkonfig diff --git a/ports/espressif/boards/maker_badge/sdkonfig b/ports/espressif/boards/maker_badge/sdkonfig new file mode 100644 index 0000000000..5a33657fdc --- /dev/null +++ b/ports/espressif/boards/maker_badge/sdkonfig @@ -0,0 +1,6 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=n + +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# end of LWIP From 1f6cd7bfac6fa208847e8da9fddc1dafd50fbc40 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 2 Nov 2022 17:39:34 -0500 Subject: [PATCH 041/357] This compatibility name has been removed in 8.x --- shared-bindings/adafruit_pixelbuf/__init__.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/shared-bindings/adafruit_pixelbuf/__init__.c b/shared-bindings/adafruit_pixelbuf/__init__.c index 7b8d0da829..40bf80094c 100644 --- a/shared-bindings/adafruit_pixelbuf/__init__.c +++ b/shared-bindings/adafruit_pixelbuf/__init__.c @@ -38,8 +38,6 @@ //| The `adafruit_pixelbuf` module provides the :py:class:`PixelBuf` class to accelerate //| RGB(W) strip/matrix manipulation, such as DotStar and Neopixel. //| -//| Also available as ``_pixelbuf``. This usage has been deprecated. -//| //| Byteorders are configured with strings, such as "RGB" or "RGBD".""" // TODO: Pull in docs from adafruit_pixelbuf. From 91da267a8764e48e8cbc5f996abe317e9b3ecd6b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 2 Nov 2022 19:23:52 -0500 Subject: [PATCH 042/357] Pin python version 3.10 for builds Python 3.11 started to roll out to github actions, and .. it doesn't work. This MAY affect just the espressif build, but I'm pinning it back at 3.10 for all builds. Typical failure, during "Run $IDF_PATH/tools/idf_tools.py --non-interactive install required" shows a lot of failures building gevent: ``` ... Collecting gevent<2.0,>=1.2.2 Downloading gevent-1.5.0.tar.gz (5.3 MB) ... Building wheel for gevent (pyproject.toml): finished with status 'error' ... src/gevent/_greenlet_primitives.c:216:12: fatal error: longintrepr.h: No such file or directory 216 | #include "longintrepr.h" | ^~~~~~~~~~~~~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 ``` I notice that gevent is pinned at <2.0 while the current version is 22.10.2! This is a dependency of gdbgui==0.13.2.0, which is installed by esp-idf pinned at that version. --- .github/workflows/build.yml | 14 +++++++------- .github/workflows/create_website_pr.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8338528c42..0dc47946b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - name: Get CP deps run: python tools/ci_fetch_deps.py test ${{ github.sha }} - name: CircuitPython version @@ -156,7 +156,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - name: Get CP deps run: python tools/ci_fetch_deps.py mpy-cross-mac ${{ github.sha }} - name: CircuitPython version @@ -220,7 +220,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - name: Install dependencies run: | sudo apt-get update @@ -278,7 +278,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - uses: actions/checkout@v3 with: submodules: false @@ -331,7 +331,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - uses: actions/checkout@v3 with: submodules: false @@ -384,7 +384,7 @@ jobs: id: py3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - uses: actions/checkout@v3 with: submodules: false @@ -473,7 +473,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - uses: actions/checkout@v3 with: submodules: false diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 75de556c68..1658fe092c 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - name: Get CP deps run: python tools/ci_fetch_deps.py website ${{ github.sha }} - name: Install deps diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a23dcd1d11..556f89e63c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.10" - name: Install deps run: | sudo apt-get install -y gettext uncrustify From 722f4561c4428c711b86261c17e4a5edc3b0101a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 3 Nov 2022 15:38:46 -0500 Subject: [PATCH 043/357] Update circuitpython.pot --- locale/circuitpython.pot | 4 ---- 1 file changed, 4 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index ac6dd92211..768daa8651 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -3843,10 +3843,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/maker_badge/mpconfigboard.h -msgid "pressing boot button at start up.\n" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" msgstr "" From f3ec46bbb5a97e5218282f1f3ae02cf7dfbadc0d Mon Sep 17 00:00:00 2001 From: Petr Sedlacek Date: Thu, 3 Nov 2022 15:35:49 +0100 Subject: [PATCH 044/357] Add missing pin definitions for 42. Keebs Frood --- ports/raspberrypi/boards/42keebs_frood/pins.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/raspberrypi/boards/42keebs_frood/pins.c b/ports/raspberrypi/boards/42keebs_frood/pins.c index d5cf864768..972d5354b6 100644 --- a/ports/raspberrypi/boards/42keebs_frood/pins.c +++ b/ports/raspberrypi/boards/42keebs_frood/pins.c @@ -43,6 +43,11 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { 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_LED), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_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) }, From 39bab07973f1425da281c7b500eb566e6cc98321 Mon Sep 17 00:00:00 2001 From: Ettore Atalan Date: Thu, 3 Nov 2022 14:22:46 +0000 Subject: [PATCH 045/357] Translated using Weblate (German) Currently translated at 99.8% (1001 of 1003 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index bb53013fac..6fc8b9758b 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,14 +6,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-10-13 06:43+0000\n" +"PO-Revision-Date: 2022-11-04 15:05+0000\n" "Last-Translator: Ettore Atalan \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "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.15-dev\n" +"X-Generator: Weblate 4.14.2-dev\n" #: main.c msgid "" @@ -69,7 +69,7 @@ msgstr "%%c erwartet Int oder Char" #: main.c #, c-format msgid "%02X" -msgstr "" +msgstr "%02X" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -600,7 +600,7 @@ msgstr "Sowohl RX als auch TX sind zu Flusssteuerung erforderlich" #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "Both buttons were pressed at start up.\n" -msgstr "" +msgstr "Beim Starten wurden beide Tasten gedrückt.\n" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -670,7 +670,7 @@ msgstr "Bus-Pin %d wird schon benutzt" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "Button A was pressed at start up.\n" -msgstr "" +msgstr "Beim Starten wurde Taste A gedrückt.\n" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -960,7 +960,7 @@ msgstr "Erwartete ein %q oder %q" #: shared-bindings/alarm/__init__.c msgid "Expected an %q" -msgstr "" +msgstr "Erwartet ein %q" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -2032,7 +2032,7 @@ msgstr "Zeitüberschreitung beim Auslesen der Temperatur" #: supervisor/shared/safe_mode.c msgid "The BOOT button was pressed at start up.\n" -msgstr "" +msgstr "Beim Starten wurde die Taste BOOT gedrückt.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2044,11 +2044,11 @@ msgstr "" #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "The SW38 button was pressed at start up.\n" -msgstr "" +msgstr "Beim Starten wurde die Taste SW38 gedrückt.\n" #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "The VOLUME button was pressed at start up.\n" -msgstr "" +msgstr "Beim Starten wurde die Taste VOLUME gedrückt.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2060,11 +2060,11 @@ msgstr "" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" -msgstr "" +msgstr "Beim Starten wurde die zentrale Taste gedrückt.\n" #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "The left button was pressed at start up.\n" -msgstr "" +msgstr "Beim Starten wurde die linke Taste gedrückt.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" @@ -2192,7 +2192,7 @@ msgstr "UART wird geschrieben" #: main.c msgid "UID:" -msgstr "" +msgstr "UID:" #: shared-module/usb_hid/Device.c msgid "USB busy" From ad9db01f5f6c52e11ab434051f76d5fba2721b63 Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Fri, 4 Nov 2022 13:15:15 -0700 Subject: [PATCH 046/357] Implements PDMIn for STM32L4 using the SAI peripheral and decimation/filtering in software. --- locale/circuitpython.pot | 10 + ports/stm/Makefile | 11 + ports/stm/boards/swan_r5/mpconfigboard.mk | 8 +- ports/stm/boards/swan_r5/pins.c | 3 + ports/stm/common-hal/audiobusio/I2SOut.c | 1 + ports/stm/common-hal/audiobusio/I2SOut.h | 1 + ports/stm/common-hal/audiobusio/MEMS_Audio.c | 72 ++++ ports/stm/common-hal/audiobusio/MEMS_Audio.h | 132 +++++++ .../stm/common-hal/audiobusio/MEMS_Audio_ll.h | 50 +++ .../audiobusio/MEMS_Audio_ll_stm32l4.c | 361 ++++++++++++++++++ .../audiobusio/MEMS_Audio_ll_stm32l4.h | 184 +++++++++ .../stm/common-hal/audiobusio/OpenPDMFilter.c | 302 +++++++++++++++ .../stm/common-hal/audiobusio/OpenPDMFilter.h | 112 ++++++ ports/stm/common-hal/audiobusio/PDMIn.c | 199 ++++++++++ ports/stm/common-hal/audiobusio/PDMIn.h | 56 +++ ports/stm/common-hal/audiobusio/__init__.c | 0 supervisor/shared/memory.c | 3 + 17 files changed, 1502 insertions(+), 3 deletions(-) create mode 100644 ports/stm/common-hal/audiobusio/I2SOut.c create mode 100644 ports/stm/common-hal/audiobusio/I2SOut.h create mode 100644 ports/stm/common-hal/audiobusio/MEMS_Audio.c create mode 100644 ports/stm/common-hal/audiobusio/MEMS_Audio.h create mode 100644 ports/stm/common-hal/audiobusio/MEMS_Audio_ll.h create mode 100644 ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c create mode 100644 ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h create mode 100644 ports/stm/common-hal/audiobusio/OpenPDMFilter.c create mode 100644 ports/stm/common-hal/audiobusio/OpenPDMFilter.h create mode 100644 ports/stm/common-hal/audiobusio/PDMIn.c create mode 100644 ports/stm/common-hal/audiobusio/PDMIn.h create mode 100644 ports/stm/common-hal/audiobusio/__init__.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 768daa8651..348ef33021 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -3714,10 +3714,20 @@ msgid "offset out of bounds" msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/ports/stm/Makefile b/ports/stm/Makefile index afde51bdc0..cd37a9bda0 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -234,6 +234,17 @@ SRC_C += \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/periph.c \ packages/$(MCU_PACKAGE).c +ifneq ($(CIRCUITPY_AUDIOBUSIO_PDMIN),0) + SRC_C += \ + common-hal/audiobusio/MEMS_Audio.c \ + common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c \ + common-hal/audiobusio/OpenPDMFilter.c + + SRC_STM32 += \ + $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_hal_sai.c + +endif + ifneq ($(CIRCUITPY_USB),0) SRC_C += lib/tinyusb/src/portable/st/synopsys/dcd_synopsys.c endif diff --git a/ports/stm/boards/swan_r5/mpconfigboard.mk b/ports/stm/boards/swan_r5/mpconfigboard.mk index 2ebaa9c23f..9e5be99bfa 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.mk +++ b/ports/stm/boards/swan_r5/mpconfigboard.mk @@ -41,10 +41,9 @@ CIRCUITPY_PULSEIO = 1 CIRCUITPY_PWMIO = 1 CIRCUITPY_AUDIOPWMIO = 1 CIRCUITPY_CANIO = 0 -CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_I2CTARGET = 0 # Requires SPI, PulseIO (stub ok): -CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_DISPLAYIO = 1 # These modules are implemented in shared-module/ - they can be included in # any port once their prerequisites in common-hal are complete. @@ -71,5 +70,8 @@ CIRCUITPY_BUSDEVICE = 0 CIRCUITPY_KEYPAD = 1 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_RTC = 1 - CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 +CIRCUITPY_ENABLE_MPY_NATIVE = 1 +CIRCUITPY_AUDIOBUSIO = 1 +CIRCUITPY_AUDIOBUSIO_I2SOUT = 0 +CIRCUITPY_AUDIOBUSIO_PDMIN = 1 diff --git a/ports/stm/boards/swan_r5/pins.c b/ports/stm/boards/swan_r5/pins.c index cf97c3587a..dc273cb6d4 100644 --- a/ports/stm/boards/swan_r5/pins.c +++ b/ports/stm/boards/swan_r5/pins.c @@ -129,5 +129,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_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_ROM_QSTR(MP_QSTR_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_MICROPHONE_DATA), MP_ROM_PTR(&pin_PC03) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/common-hal/audiobusio/I2SOut.c b/ports/stm/common-hal/audiobusio/I2SOut.c new file mode 100644 index 0000000000..b63c3e7b22 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/I2SOut.c @@ -0,0 +1 @@ +// Although IS2Out is not enabled on the STM32L4 family, this file is still required for the build to pass diff --git a/ports/stm/common-hal/audiobusio/I2SOut.h b/ports/stm/common-hal/audiobusio/I2SOut.h new file mode 100644 index 0000000000..b63c3e7b22 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/I2SOut.h @@ -0,0 +1 @@ +// Although IS2Out is not enabled on the STM32L4 family, this file is still required for the build to pass diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio.c b/ports/stm/common-hal/audiobusio/MEMS_Audio.c new file mode 100644 index 0000000000..4371b609c0 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio.c @@ -0,0 +1,72 @@ +#include +#include + +#include "MEMS_Audio.h" +#include "MEMS_Audio_ll.h" + +static void default_pcm_data_available(MemsAudio *audio, pcm_sample_t *pcmSamples, size_t pcmLength) { +} + + + +/** + * @brief Initializes the MemsAudio instance. Only one instance can be initialized and used at a given time. + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_init(MemsAudio *audio) { + if (!audio->pcm_data_available) { + audio->pcm_data_available = default_pcm_data_available; + } + return mems_audio_ll_init(audio); +} + +/** + * @brief Uninitializes the MemsAudio instance. + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_uninit(MemsAudio *audio) { + return mems_audio_ll_uninit(audio); +} + +/** + * @brief Asynchronously records audio. + * + * @param audio + * @param pdmBuffer + * @param pdmBufferLength + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_record(MemsAudio *audio) { + return mems_audio_ll_record(audio); +} + +/** + * @brief Pause recording audio. + */ +mems_audio_err_t mems_audio_pause(MemsAudio *audio) { + return mems_audio_ll_pause(audio); +} + +/** + * @brief Resume recording audio. + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_resume(MemsAudio *audio) { + return mems_audio_ll_resume(audio); +} + +/** + * @brief Stop recording audio and + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_stop(MemsAudio *audio) { + return mems_audio_ll_stop(audio); +} diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio.h b/ports/stm/common-hal/audiobusio/MEMS_Audio.h new file mode 100644 index 0000000000..a26b94fef3 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio.h @@ -0,0 +1,132 @@ +#ifndef _MEMS_AUDIO_H_ +#define _MEMS_AUDIO_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @brief How many milliseconds of audio can fit in the audio buffer(s). + * Interrupts for recieved data fire at half this duration / twice the frequency. + */ +#ifndef MEMS_AUDIO_MS_BUFFER +#define MEMS_AUDIO_MS_BUFFER (1) +#endif + + +/** + * @brief The number of bits per sample of the PCM output + */ +#define PCM_OUT_RESOLUTION 16 + +/** + * @brief The output frequency of PCM samples in Hz. + */ +#define PCM_OUT_SAMPLING_FREQUENCY 16000 + +/** + * @brief type for describing error conditions. + */ +typedef int32_t mems_audio_err_t; + +/** + * @brief The datatype that holds an output PCM sample. + */ +typedef int16_t pcm_sample_t; +_Static_assert(PCM_OUT_RESOLUTION==16, "Output PCM resolution must be 16-bits"); + + +typedef enum { + MEMS_AUDIO_OK = 0, + MEMS_AUDIO_ERROR_ALREADY_INITIALIZED = -1, + MEMS_AUDIO_ERROR_NOT_INITIALIZED = -2 +} mems_audio_err_enum_t; + +#define IS_MEMS_AUDIO_ERROR(e) (e) +#define CHECK_MEMS_AUDIO_ERROR(e) { if (IS_MEMS_AUDIO_ERROR(e)) return e; } +#define CHECK_MEMS_AUDIO_INITIALIZED(x) { if (!x) return MEMS_AUDIO_ERROR_NOT_INITIALIZED; } + +typedef struct MemsAudio_t MemsAudio; + +/** + * @brief Callback informing that PCM samples are available for processing. + */ +typedef void (*pcm_data_available_t)(MemsAudio* audio, pcm_sample_t* pcmSamples, size_t pcmLength); + +/** + * @brief MemsAudio manages the filter, buffers and callbacks used to capture PDM audio samples and convert to PCM. + * + */ +typedef struct MemsAudio_t { + + /** + * @brief The buffer to store PCM audio samples + */ + volatile pcm_sample_t* volatile pcmOutputBuffer; + + /** + * @brief The length of the PCM buffer. SHould be at least MEMS_AUDIO_PCM_BUFFER_LENGTH + */ + volatile size_t pcmOutputBufferLength; + + /** + * @brief Optional callback for when PCM data is available. + */ + pcm_data_available_t pcm_data_available; + + void* audioImpl; + void* userData; +} MemsAudio; + + +mems_audio_err_t mems_audio_init(MemsAudio* audio); + +/** + * @brief Uninitializes the MemsAudio instance. + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_uninit(MemsAudio* audio); + +/** + * @brief Asynchronously records audio. + * + * @param audio + * @param pdmBuffer + * @param pdmBufferLength + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_record(MemsAudio* audio); + +/** + * @brief Pause recording audio. + */ +mems_audio_err_t mems_audio_pause(MemsAudio* audio); + +/** + * @brief Resume recording audio. + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_resume(MemsAudio* audio); + +/** + * @brief Stop recording audio and + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_stop(MemsAudio* audio); + +#ifdef __cplusplus +} +#endif + + +#endif // _MEMS_AUDIO_H_ diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll.h b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll.h new file mode 100644 index 0000000000..6419b90959 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll.h @@ -0,0 +1,50 @@ +#ifndef _MEMS_AUDIO_LL_H_ +#define _MEMS_AUDIO_LL_H_ + +#include "MEMS_Audio.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +mems_audio_err_t mems_audio_ll_init(MemsAudio *audio); +mems_audio_err_t mems_audio_ll_uninit(MemsAudio *audio); + +/** + * @brief Asynchronously records audio. + * + * @param audio + * @param pdmBuffer + * @param pdmBufferLength + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_ll_record(MemsAudio *audio); + +/** + * @brief Pause recording audio. + */ +mems_audio_err_t mems_audio_ll_pause(MemsAudio *audio); + +/** + * @brief Resume recording audio. + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_ll_resume(MemsAudio *audio); + +/** + * @brief Stop recording audio and + * + * @param audio + * @return mems_audio_err_t + */ +mems_audio_err_t mems_audio_ll_stop(MemsAudio *audio); + +#ifdef __cplusplus +} +#endif + + +#endif // _MEMS_AUDIO_LL_H_ diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c new file mode 100644 index 0000000000..71f046f9b9 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c @@ -0,0 +1,361 @@ +#include +#include "MEMS_Audio_ll_stm32l4.h" +#include "MEMS_Audio.h" + +/** + * @brief The implementation is a singleton. + * + */ +MemsAudio_STM32L4SAIPDM* volatile audioImpl; + +static mems_audio_err_t MX_DMA_Init(void); +static mems_audio_err_t MX_DMA_Uninit(void); +static mems_audio_err_t MX_SAI1_Init(void); + +#define CHECK_HAL_ERROR(x, e) \ + { \ + if ((x) != HAL_OK) \ + return e; \ + } + +/** + * @brief Checks the HAL return code and returns from a void function on error. The + * error is saved to lastError. + */ +#define CHECK_HAL_ERROR_VOID(x, e) \ + { \ + if ((x) != HAL_OK) { \ + audioImpl->lastError = e; \ + return; \ + } \ + } + +#define CHECK_MEMS_AUDIO_ERROR_LAST() \ + { \ + if (audioImpl->lastError != MEMS_AUDIO_OK) \ + return audioImpl->lastError; \ + } + +static bool default_pdm_data_available(MemsAudio_STM32L4SAIPDM* audio, pdm_sample_t* pdmSamples, size_t count) +{ + return true; +} + +int filter_pdm(MemsAudio_STM32L4SAIPDM* impl, pdm_sample_t* input, pcm_sample_t* output) +{ + if (impl->filter.Decimation==64) { + Open_PDM_Filter_64(input, output, 1, &impl->filter); + } + else { + Open_PDM_Filter_128(input, output, 1, &impl->filter); + } + return impl->filter.nSamples; +} + +static void mems_audio_init_filter(MemsAudio_STM32L4SAIPDM *impl) +{ + TPDMFilter_InitStruct* filter = &impl->filter; + filter->Fs = PCM_OUT_SAMPLING_FREQUENCY; + filter->nSamples = MEMS_AUDIO_PCM_BUFFER_LENGTH; + filter->LP_HZ = PCM_OUT_SAMPLING_FREQUENCY / 2; // The Nyquist frequency + filter->HP_HZ = 10; // high pass to remove DC offset + filter->In_MicChannels = 1; + filter->Out_MicChannels = 1; + filter->Decimation = PDM_IN_DECIMATION_FACTOR; + Open_PDM_Filter_Init(filter); +} +volatile unsigned ignore_dma_count; + +/** + * @brief Converts PDM samples + * + * @param pdmBuffer The buffer holding the PDM samples + * @param pdmBufferLength The number of samples available + */ +void pdm2pcm(uint8_t *pdmBuffer, size_t pdmBufferLength) +{ + MemsAudio_STM32L4SAIPDM *impl = audioImpl; + if (impl) + { + bool convert = impl->discard_dma || impl->pdm_data_available(impl, pdmBuffer, pdmBufferLength); + if (convert) + { + MemsAudio* audio = impl->audio; + filter_pdm(impl, pdmBuffer, (pcm_sample_t*)audio->pcmOutputBuffer); + if (!impl->discard_dma) + audio->pcm_data_available(audio, (pcm_sample_t*)audio->pcmOutputBuffer, impl->filter.nSamples); + else + impl->discard_dma--; + } + } +} + +/** + * @brief Initialize the PDM interface ready to begin capture. + * @retval + */ +mems_audio_err_t mems_audio_ll_init(MemsAudio *audio) +{ + mems_audio_init_filter(audioImpl); + if (!audioImpl->pdm_data_available) { + audioImpl->pdm_data_available = &default_pdm_data_available; + } + + CHECK_MEMS_AUDIO_ERROR(MX_DMA_Init()); + CHECK_MEMS_AUDIO_ERROR(MX_SAI1_Init()); + return MEMS_AUDIO_OK; +} + +mems_audio_err_t uninit(void) { + if (audioImpl) { + MemsAudio_STM32L4SAIPDM* impl = audioImpl; + audioImpl = NULL; + mems_audio_ll_stop(impl->audio); + CHECK_HAL_ERROR(HAL_SAI_DeInit(&impl->hSAI_BlockA1), MEMS_AUDIO_ERROR_SAI_DEINIT); + CHECK_MEMS_AUDIO_ERROR(MX_DMA_Uninit()); + } + return MEMS_AUDIO_OK; +} + +/** + * @brief Uninitialize low level PDM capture + */ +mems_audio_err_t mems_audio_ll_uninit(MemsAudio *audio) +{ + if (audioImpl->audio == audio) { + uninit(); + } + return MEMS_AUDIO_OK; +} + +mems_audio_err_t mems_audio_ll_record(MemsAudio *audio) +{ + audioImpl->discard_dma = (100/MEMS_AUDIO_MS_BUFFER)+1; + CHECK_HAL_ERROR(HAL_SAI_Receive_DMA(&audioImpl->hSAI_BlockA1, audioImpl->pdmBuffer, audioImpl->pdmBufferLength), + MEMS_AUDIO_ERROR_DMA_START); + return MEMS_AUDIO_OK; +} + +mems_audio_err_t mems_audio_ll_stop(MemsAudio *audio) +{ + CHECK_HAL_ERROR(HAL_SAI_DMAStop(&audioImpl->hSAI_BlockA1), MEMS_AUDIO_ERROR_DMA_STOP); + return MEMS_AUDIO_OK; +} + +mems_audio_err_t mems_audio_ll_pause(MemsAudio *audio) +{ + CHECK_HAL_ERROR(HAL_SAI_DMAPause(&audioImpl->hSAI_BlockA1), MEMS_AUDIO_ERROR_DMA_PAUSE); + return MEMS_AUDIO_OK; +} + +mems_audio_err_t mems_audio_ll_resume(MemsAudio *audio) +{ + CHECK_HAL_ERROR(HAL_SAI_DMAResume(&audioImpl->hSAI_BlockA1), MEMS_AUDIO_ERROR_DMA_RESUME); + return MEMS_AUDIO_OK; +} + +/** + * @brief SAI1 Initialization Function + * @param None + * @retval None + */ +static mems_audio_err_t MX_SAI1_Init(void) +{ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + + SAI_HandleTypeDef hSAI_BlockA1 = {0}; + MemsAudio_STM32L4SAIPDM* impl = audioImpl; + CHECK_MEMS_AUDIO_INITIALIZED(impl); + hSAI_BlockA1.Instance = SAI1_Block_A; + hSAI_BlockA1.Init.Protocol = SAI_FREE_PROTOCOL; + hSAI_BlockA1.Init.AudioMode = SAI_MODEMASTER_RX; + /* The PDM interface provides 8 1-bit samples at a time */ + hSAI_BlockA1.Init.DataSize = SAI_DATASIZE_8; + hSAI_BlockA1.Init.FirstBit = SAI_FIRSTBIT_MSB; + + hSAI_BlockA1.Init.ClockStrobing = SAI_CLOCKSTROBING_FALLINGEDGE; + hSAI_BlockA1.Init.Synchro = SAI_ASYNCHRONOUS; /* asynchronous - not chained to other SAI blocks */ + hSAI_BlockA1.Init.OutputDrive = SAI_OUTPUTDRIVE_DISABLE; /* Not driving the primary SAI clock */ + hSAI_BlockA1.Init.NoDivider = SAI_MASTERDIVIDER_DISABLE; + hSAI_BlockA1.Init.MckOverSampling = SAI_MCK_OVERSAMPLING_DISABLE; + hSAI_BlockA1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_FULL; + hSAI_BlockA1.Init.MonoStereoMode = SAI_MONOMODE; /* PDM is intrinsicly stereo, sampling on */ + hSAI_BlockA1.Init.CompandingMode = SAI_NOCOMPANDING; + hSAI_BlockA1.Init.PdmInit.Activation = ENABLE; /* Enable PDM interface in the SAI */ + hSAI_BlockA1.Init.PdmInit.MicPairsNbr = 1; /* 1 pair - 2 mics */ + hSAI_BlockA1.Init.PdmInit.ClockEnable = SAI_PDM_CLOCK1_ENABLE; + hSAI_BlockA1.FrameInit.FrameLength = 16; + hSAI_BlockA1.FrameInit.ActiveFrameLength = 1; + hSAI_BlockA1.FrameInit.FSDefinition = SAI_FS_STARTFRAME; /* FS is not really used */ + hSAI_BlockA1.FrameInit.FSPolarity = SAI_FS_ACTIVE_HIGH; + hSAI_BlockA1.FrameInit.FSOffset = SAI_FS_FIRSTBIT; + hSAI_BlockA1.SlotInit.FirstBitOffset = 0; + hSAI_BlockA1.SlotInit.SlotSize = SAI_SLOTSIZE_DATASIZE; + hSAI_BlockA1.SlotInit.SlotNumber = 2; + hSAI_BlockA1.SlotInit.SlotActive = 0x0001; + impl->hSAI_BlockA1 = hSAI_BlockA1; + CHECK_HAL_ERROR(HAL_SAI_Init(&impl->hSAI_BlockA1), MEMS_AUDIO_ERROR_SAI_INIT); + CHECK_MEMS_AUDIO_ERROR_LAST(); + return MEMS_AUDIO_OK; +} + +#define MEMS_AUDIO_DMA_IRQn DMA1_Channel6_IRQn +#define MEMS_AUDIO_DMA_CHANNEL DMA1_Channel6 +#define MEMS_AUDIO_DMA_PRIORITY 6 +#define DMA_HANDLER DMA1_Channel6_IRQHandler + +void HAL_SAI_MspInit(SAI_HandleTypeDef *hsai) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; + /* SAI1 */ + MemsAudio_STM32L4SAIPDM* impl = audioImpl; + if (hsai->Instance == SAI1_Block_A && impl) + { + PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_SAI1; + PeriphClkInit.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLLSAI1; + PeriphClkInit.PLLSAI1.PLLSAI1Source = RCC_PLLSOURCE_MSI; + PeriphClkInit.PLLSAI1.PLLSAI1M = MEMS_AUDIO_CLOCK_PLLM; + PeriphClkInit.PLLSAI1.PLLSAI1N = MEMS_AUDIO_CLOCK_PLLN; + PeriphClkInit.PLLSAI1.PLLSAI1P = MEMS_AUDIO_CLOCK_PLLP; + PeriphClkInit.PLLSAI1.PLLSAI1Q = RCC_PLLQ_DIV2; + PeriphClkInit.PLLSAI1.PLLSAI1R = RCC_PLLR_DIV2; + PeriphClkInit.PLLSAI1.PLLSAI1ClockOut = RCC_PLLSAI1_SAI1CLK; + CHECK_HAL_ERROR_VOID(HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit), MEMS_AUDIO_ERROR_SAI_CLOCK); + + if (impl->SAI1_client == 0) + { + __HAL_RCC_SAI1_CLK_ENABLE(); + } + impl->SAI1_client++; + + /**SAI1_A_Block_A GPIO Configuration + PC3 ------> SAI1_D1 + PA3 ------> SAI1_CK1 + */ + GPIO_InitStruct.Pin = GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF3_SAI1; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF3_SAI1; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* Peripheral DMA init*/ + DMA_HandleTypeDef hdma_sai1_a = {0}; + hdma_sai1_a.Instance = MEMS_AUDIO_DMA_CHANNEL; + hdma_sai1_a.Init.Request = DMA_REQUEST_SAI1_A; + hdma_sai1_a.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_sai1_a.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_sai1_a.Init.MemInc = DMA_MINC_ENABLE; + hdma_sai1_a.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; + hdma_sai1_a.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; + hdma_sai1_a.Init.Mode = DMA_CIRCULAR; + hdma_sai1_a.Init.Priority = DMA_PRIORITY_HIGH; + impl->hdma_sai1_a = hdma_sai1_a; + CHECK_HAL_ERROR_VOID(HAL_DMA_Init(&impl->hdma_sai1_a), MEMS_AUDIO_ERROR_SAI_DMA_INIT); + + /* Several peripheral DMA handle pointers point to the same DMA handle. + Be aware that there is only one channel to perform all the requested DMAs. */ + __HAL_LINKDMA(hsai, hdmarx, impl->hdma_sai1_a); + + __HAL_LINKDMA(hsai, hdmatx, impl->hdma_sai1_a); + } +} + +void HAL_SAI_MspDeInit(SAI_HandleTypeDef *hsai) +{ + /* SAI1 */ + MemsAudio_STM32L4SAIPDM* impl = audioImpl; + if (hsai->Instance == SAI1_Block_A && impl) + { + impl->SAI1_client--; + if (impl->SAI1_client == 0) + { + /* Peripheral clock disable */ + __HAL_RCC_SAI1_CLK_DISABLE(); + } + + /**SAI1_A_Block_A GPIO Configuration + PC3 ------> SAI1_D1 + PA3 ------> SAI1_CK1 + */ + HAL_GPIO_DeInit(GPIOC, GPIO_PIN_3); + + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_3); + + /* SAI1 DMA Deinit */ + HAL_DMA_DeInit(hsai->hdmarx); + HAL_DMA_DeInit(hsai->hdmatx); + } +} + +/** + * @brief Initialize the DMA peripheral + * + */ +static mems_audio_err_t MX_DMA_Init(void) +{ + + /* DMA controller clock enable */ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); + __HAL_RCC_DMA1_CLK_ENABLE(); + + /* DMA interrupt init */ + /* DMA1_Channel1_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(MEMS_AUDIO_DMA_IRQn, MEMS_AUDIO_DMA_PRIORITY, 0); + HAL_NVIC_EnableIRQ(MEMS_AUDIO_DMA_IRQn); + return MEMS_AUDIO_OK; +} + +static mems_audio_err_t MX_DMA_Uninit(void) +{ + HAL_NVIC_DisableIRQ(MEMS_AUDIO_DMA_IRQn); + return MEMS_AUDIO_OK; +} + +/** + * @brief Global handler for the DMA interrupt. Forwards to the HAL for further processing. + * + */ +void DMA_HANDLER(void) +{ + HAL_DMA_IRQHandler(&audioImpl->hdma_sai1_a); +} + +/** + * @brief Converts PDM samples in the upper half of the PDM buffer. + * + * @param hSai + */ +void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hSai) +{ + (void)hSai; + pdm2pcm(audioImpl->pdmBuffer, audioImpl->pdmBufferLength>>1); +} + +/** + * @brief Converts PDM samples in the upper half of the PDM buffer. + * + * @param hSai + */ +void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hSai) +{ + (void)hSai; + pdm2pcm(audioImpl->pdmBuffer+(audioImpl->pdmBufferLength>>1), audioImpl->pdmBufferLength>>1); +} + +mems_audio_err_t mems_audio_init_stm32l4_sai_pdm(MemsAudio* audio, MemsAudio_STM32L4SAIPDM* impl) +{ + uninit(); + audioImpl = impl; + impl->audio = audio; + return mems_audio_init(audio); +} diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h new file mode 100644 index 0000000000..c76ccce5e1 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h @@ -0,0 +1,184 @@ +#ifndef _MEMS_AUDIO_LL_STM32L4_H_ +#define _MEMS_AUDIO_LL_STM32L4_H_ + +#include +#include +#include +#include "OpenPDMFilter.h" +#include "MEMS_Audio.h" +#include "MEMS_Audio_ll.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief The SAI PDM interface captures 8 bits from the PDM signal. + */ +typedef uint8_t pdm_sample_t; + +/** + * @brief The PDM sample frequency in kHz. (Bit samples per millisecond.) + */ +#define PDM_IN_FREQUENCY_KHZ 1024 + +#define PDM_IN_FREQUENCY (PDM_IN_FREQUENCY_KHZ * 1000) + +/** + * @brief The number of channels of audio captured + */ +#define PDM_IN_CHANNELS 1 + +/** + * @brief The decimation of the PDM bit stream to produce PCM samples at the desired output rate. + */ +#define PDM_IN_DECIMATION_FACTOR 64 + +/** + * @brief The number of pdm samples captured per millisecond from the PDM interface. + */ +#define MEMS_AUDIO_PDM_SAMPLES_PER_MS ((PDM_IN_FREQUENCY_KHZ / (sizeof(pdm_sample_t) * 8)) * PDM_IN_CHANNELS) + +/** + * @brief The size of the buffer used to hold PDM samples prior to conversion to PCM. + * Each half of the buffer generates an interrupt. + */ +#define MEMS_AUDIO_PDM_BUFFER_LENGTH (MEMS_AUDIO_PDM_SAMPLES_PER_MS * MEMS_AUDIO_MS_BUFFER * 2) + +/** + * @brief The length of the PCM buffer required to hold converted samples. + */ +#define MEMS_AUDIO_PCM_BUFFER_LENGTH (PCM_OUT_SAMPLING_FREQUENCY * MEMS_AUDIO_MS_BUFFER / 1000) + + +/** + * Presently the internal PDM parameters and output PCM parameters are fixed for the values given here. + */ + + +/** + * @brief 128 point decimation did not work with the OpenPDMFilter and just produced PCM output + * approaching a square wave. + */ +_Static_assert(PDM_IN_DECIMATION_FACTOR == 64 || PDM_IN_DECIMATION_FACTOR == 128, "A decomation factor of 64 or 128 is supported at present."); + + +/** + * @brief The PDM bitstream frequency divided by the decimation factor should be the same as the desired output PCM frequency. + */ +_Static_assert(PDM_IN_FREQUENCY / PDM_IN_DECIMATION_FACTOR == PCM_OUT_SAMPLING_FREQUENCY, "PDM output frequency should equal the input frequency divided by the decimation factor."); + +// +// SAI PDM interface clock configuration +// + +#define MEMS_AUDIO_MSI_FREQUENCY (48 * 1000 * 1000) +#define MEMS_AUDIO_CLOCK_PLLM (15) +#define MEMS_AUDIO_CLOCK_PLLN (16) +#define MEMS_AUDIO_CLOCK_PLLP (RCC_PLLP_DIV25) + +/** + * @brief The SAI PDM clock should be twice the desired PDM bitstream frequency + */ +_Static_assert((MEMS_AUDIO_MSI_FREQUENCY / MEMS_AUDIO_CLOCK_PLLM * MEMS_AUDIO_CLOCK_PLLN / MEMS_AUDIO_CLOCK_PLLP) == (PDM_IN_FREQUENCY_KHZ * 1000 * 2), "PDM clock should be twice the PDM sample frequency."); + +typedef struct MemsAudio_STM32L4SAIPDM_t MemsAudio_STM32L4SAIPDM; + +/** + * @brief Callback informing that PDM samples are available for processing. + * @param audio The MemsAudio instance + * @return `false` to skip conversion of PDM to PCM. `true` to convert the PDM samples to PCM. + */ +typedef bool (*pdm_data_available_t)(MemsAudio_STM32L4SAIPDM *audio, pdm_sample_t *pdmSamples, size_t pdmLength); + +/** + * @brief Implementation details for the STM32 SAI PDM implementation. + * + */ +/** + * @brief Audio capture from a MEMS microphone on the STM32L4 using the SAI PDM interface. + */ +typedef struct MemsAudio_STM32L4SAIPDM_t { + + MemsAudio *audio; + + /** + * @brief The last error that happened in a void function (e.g. HAL callback) + */ + mems_audio_err_t lastError; + + /** + * @brief The buffer to store PDM audio samples + */ + pdm_sample_t *pdmBuffer; + + /** + * @brief The length of the PDM buffer. Should be at least MEMS_AUDIO_PDM_BUFFER_LENGTH + */ + size_t pdmBufferLength; + + /** + * @brief Optional callback for when PDM data is available. + */ + pdm_data_available_t pdm_data_available; + + /** + * @brief A cound of the number of PDM clients in use. + */ + uint32_t SAI1_client; + + /** + * @brief The SAI peripheral handle being used for SAI A subclock 1. + */ + SAI_HandleTypeDef hSAI_BlockA1; + + /** + * @brief The DMA handle to transfer SAI data from the peripheral to memory. + */ + DMA_HandleTypeDef hdma_sai1_a; + + /** + * @brief An instance of the PDM filter that performs decimation, and high and low pass filtering. + * Unlike the DFSDM peripheral, the SAI PDM interface doesn't perform these operations in hardware. + */ + TPDMFilter_InitStruct filter; + + /** + * @brief The number of DMA transfers to ignore after starting recording. + */ + volatile uint16_t discard_dma; + +} MemsAudio_STM32L4SAIPDM; + +/** + * @brief Creates a MemsAudio instance that retrieves PDM samples from SAI A block 1 via the PDM interface, + * decimates and filters these in software to produce the PCM output stream. + * + * @param audio + * @param implementation + * @return meems_audio_error_t + */ +mems_audio_err_t mems_audio_init_stm32l4_sai_pdm(MemsAudio *audio, MemsAudio_STM32L4SAIPDM *implementation); + +/** + * @brief Implementation-specific error codes. + * + */ +typedef enum mems_audio_err_stm32l4_t { + MEMS_AUDIO_ERROR_SAI_DMA_INIT = 1, + MEMS_AUDIO_ERROR_SAI_CLOCK = 2, + MEMS_AUDIO_ERROR_SAI_INIT = 3, + MEMS_AUDIO_ERROR_SAI_DEINIT = 4, + MEMS_AUDIO_ERROR_DMA_START = 5, + MEMS_AUDIO_ERROR_DMA_STOP = 6, + MEMS_AUDIO_ERROR_DMA_PAUSE = 7, + MEMS_AUDIO_ERROR_DMA_RESUME = 8 +} mems_audio_err_stm32l4_t; + + +#ifdef __cplusplus +} +#endif + + +#endif // _MEMS_AUDIO_LL_STM32L4_H_ diff --git a/ports/stm/common-hal/audiobusio/OpenPDMFilter.c b/ports/stm/common-hal/audiobusio/OpenPDMFilter.c new file mode 100644 index 0000000000..c65353b146 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/OpenPDMFilter.c @@ -0,0 +1,302 @@ +/** + ******************************************************************************* + * @file OpenPDMFilter.c + * @author CL + * @version V1.0.0 + * @date 9-September-2015 + * @brief Open PDM audio software decoding Library. + * This Library is used to decode and reconstruct the audio signal + * produced by ST MEMS microphone (MP45Dxxx, MP34Dxxx). + ******************************************************************************* + * @attention + * + *

© COPYRIGHT 2018 STMicroelectronics

+ * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************* + */ + + +/* Includes ------------------------------------------------------------------*/ + +#include "OpenPDMFilter.h" + + + +/* Functions -----------------------------------------------------------------*/ + +#ifdef USE_LUT +int32_t filter_table_mono_64(lut_t lut, uint8_t *data, uint8_t sincn) { + return (int32_t) + lut[data[0]][0][sincn] + + lut[data[1]][1][sincn] + + lut[data[2]][2][sincn] + + lut[data[3]][3][sincn] + + lut[data[4]][4][sincn] + + lut[data[5]][5][sincn] + + lut[data[6]][6][sincn] + + lut[data[7]][7][sincn]; +} +int32_t filter_table_stereo_64(lut_t lut, uint8_t *data, uint8_t sincn) { + return (int32_t) + lut[data[0]][0][sincn] + + lut[data[2]][1][sincn] + + lut[data[4]][2][sincn] + + lut[data[6]][3][sincn] + + lut[data[8]][4][sincn] + + lut[data[10]][5][sincn] + + lut[data[12]][6][sincn] + + lut[data[14]][7][sincn]; +} +#if DECIMATION_MAX == 128 +int32_t filter_table_mono_128(lut_t lut, uint8_t *data, uint8_t sincn) { + return (int32_t) + lut[data[0]][0][sincn] + + lut[data[1]][1][sincn] + + lut[data[2]][2][sincn] + + lut[data[3]][3][sincn] + + lut[data[4]][4][sincn] + + lut[data[5]][5][sincn] + + lut[data[6]][6][sincn] + + lut[data[7]][7][sincn] + + lut[data[8]][8][sincn] + + lut[data[9]][9][sincn] + + lut[data[10]][10][sincn] + + lut[data[11]][11][sincn] + + lut[data[12]][12][sincn] + + lut[data[13]][13][sincn] + + lut[data[14]][14][sincn] + + lut[data[15]][15][sincn]; +} +int32_t filter_table_stereo_128(lut_t lut, uint8_t *data, uint8_t sincn) { + return (int32_t) + lut[data[0]][0][sincn] + + lut[data[2]][1][sincn] + + lut[data[4]][2][sincn] + + lut[data[6]][3][sincn] + + lut[data[8]][4][sincn] + + lut[data[10]][5][sincn] + + lut[data[12]][6][sincn] + + lut[data[14]][7][sincn] + + lut[data[16]][8][sincn] + + lut[data[18]][9][sincn] + + lut[data[20]][10][sincn] + + lut[data[22]][11][sincn] + + lut[data[24]][12][sincn] + + lut[data[26]][13][sincn] + + lut[data[28]][14][sincn] + + lut[data[30]][15][sincn]; +} +#endif +int32_t (*filter_tables_64[2])(lut_t lut, uint8_t *data, uint8_t sincn) = {filter_table_mono_64, filter_table_stereo_64}; +#if DECIMATION_MAX == 128 +int32_t (*filter_tables_128[2])(lut_t lut, uint8_t *data, uint8_t sincn) = {filter_table_mono_128, filter_table_stereo_128}; +#endif +#else +int32_t filter_table(uint8_t *data, uint8_t sincn, TPDMFilter_InitStruct *param) { + uint8_t c, i; + uint16_t data_index = 0; + uint32_t *coef_p = ¶m->coef[sincn][0]; + int32_t F = 0; + uint8_t decimation = param->Decimation; + uint8_t channels = param->In_MicChannels; + + for (i = 0; i < decimation; i += 8) { + c = data[data_index]; + F += ((c >> 7)) * coef_p[i ] + + ((c >> 6) & 0x01) * coef_p[i + 1] + + ((c >> 5) & 0x01) * coef_p[i + 2] + + ((c >> 4) & 0x01) * coef_p[i + 3] + + ((c >> 3) & 0x01) * coef_p[i + 4] + + ((c >> 2) & 0x01) * coef_p[i + 5] + + ((c >> 1) & 0x01) * coef_p[i + 6] + + ((c) & 0x01) * coef_p[i + 7]; + data_index += channels; + } + return F; +} +#endif + +void convolve(uint32_t Signal[] /* SignalLen */, unsigned short SignalLen, + uint32_t Kernel[] /* KernelLen */, unsigned short KernelLen, + uint32_t Result[] /* SignalLen + KernelLen - 1 */) { + uint16_t n; + + for (n = 0; n < SignalLen + KernelLen - 1; n++) + { + unsigned short kmin, kmax, k; + + Result[n] = 0; + + kmin = (n >= KernelLen - 1) ? n - (KernelLen - 1) : 0; + kmax = (n < SignalLen - 1) ? n : SignalLen - 1; + + for (k = kmin; k <= kmax; k++) { + Result[n] += Signal[k] * Kernel[n - k]; + } + } +} + +void Open_PDM_Filter_Init(TPDMFilter_InitStruct *Param) { + uint16_t i, j; + int64_t sum = 0; + + uint8_t decimation = Param->Decimation; + + for (i = 0; i < SINCN; i++) { + Param->Coef[i] = 0; + Param->bit[i] = 0; + } + for (i = 0; i < decimation; i++) { + Param->sinc1[i] = 1; + } + + Param->OldOut = Param->OldIn = Param->OldZ = 0; + Param->LP_ALFA = (Param->LP_HZ != 0 ? (uint16_t)((float)Param->LP_HZ * 256 / (Param->LP_HZ + Param->Fs / (2 * 3.14159))) : 0); + Param->HP_ALFA = (Param->HP_HZ != 0 ? (uint16_t)((float)Param->Fs * 256 / (2 * 3.14159 * Param->HP_HZ + Param->Fs)) : 0); + + Param->FilterLen = decimation * SINCN; + Param->sinc[0] = 0; + Param->sinc[decimation * SINCN - 1] = 0; + convolve(Param->sinc1, decimation, Param->sinc1, decimation, Param->sinc2); + convolve(Param->sinc2, (decimation << 1) - 1, Param->sinc1, decimation, &Param->sinc[1]); + for (j = 0; j < SINCN; j++) { + for (i = 0; i < decimation; i++) { + Param->coef[j][i] = Param->sinc[j * decimation + i]; + sum += Param->sinc[j * decimation + i]; + } + } + + Param->sub_const = sum >> 1; + uint32_t div_const = Param->sub_const * Param->MaxVolume / 32768 / FILTER_GAIN; + Param->div_const = (div_const == 0 ? 1 : div_const); + + #ifdef USE_LUT + /* Look-Up Table. */ + uint16_t c, d, s; + for (s = 0; s < SINCN; s++) + { + uint32_t *coef_p = &Param->coef[s][0]; + for (c = 0; c < 256; c++) { + for (d = 0; d < decimation / 8; d++) { + Param->lut[c][d][s] = ((c >> 7)) * coef_p[d * 8 ] + + ((c >> 6) & 0x01) * coef_p[d * 8 + 1] + + ((c >> 5) & 0x01) * coef_p[d * 8 + 2] + + ((c >> 4) & 0x01) * coef_p[d * 8 + 3] + + ((c >> 3) & 0x01) * coef_p[d * 8 + 4] + + ((c >> 2) & 0x01) * coef_p[d * 8 + 5] + + ((c >> 1) & 0x01) * coef_p[d * 8 + 6] + + ((c) & 0x01) * coef_p[d * 8 + 7]; + } + } + } + #endif +} + +int Open_PDM_Filter_64(uint8_t *data, int16_t *dataOut, uint16_t volume, TPDMFilter_InitStruct *Param) { + uint8_t i, data_out_index; + uint8_t channels = Param->In_MicChannels; + uint8_t data_inc = ((DECIMATION_MAX >> 4) * channels); + int64_t Z, Z0, Z1, Z2; + int64_t OldOut, OldIn, OldZ; + + OldOut = Param->OldOut; + OldIn = Param->OldIn; + OldZ = Param->OldZ; + + #ifdef USE_LUT + uint8_t j = channels - 1; + #endif + + for (i = 0, data_out_index = 0; i < Param->nSamples; i++, data_out_index += channels) { + #ifdef USE_LUT + Z0 = filter_tables_64[j](Param->lut, data, 0); + Z1 = filter_tables_64[j](Param->lut, data, 1); + Z2 = filter_tables_64[j](Param->lut, data, 2); + #else + Z0 = filter_table(data, 0, Param); + Z1 = filter_table(data, 1, Param); + Z2 = filter_table(data, 2, Param); + #endif + + Z = Param->Coef[1] + Z2 - Param->sub_const; + Param->Coef[1] = Param->Coef[0] + Z1; + Param->Coef[0] = Z0; + + OldOut = (Param->HP_ALFA * (OldOut + Z - OldIn)) >> 8; + OldIn = Z; + OldZ = ((256 - Param->LP_ALFA) * OldZ + Param->LP_ALFA * OldOut) >> 8; + + Z = OldZ * volume; + Z = RoundDiv(Z, (Param->div_const)); + Z = SaturaLH(Z, -32700, 32700); + + dataOut[data_out_index] = Z; + data += data_inc; + } + + Param->OldOut = OldOut; + Param->OldIn = OldIn; + Param->OldZ = OldZ; + return data_out_index; +} + +#if DECIMATION_MAX == 128 +int Open_PDM_Filter_128(uint8_t *data, int16_t *dataOut, uint16_t volume, TPDMFilter_InitStruct *Param) { + uint8_t i, data_out_index; + uint8_t channels = Param->In_MicChannels; + uint8_t data_inc = ((DECIMATION_MAX >> 3) * channels); + int64_t Z, Z0, Z1, Z2; + int64_t OldOut, OldIn, OldZ; + + OldOut = Param->OldOut; + OldIn = Param->OldIn; + OldZ = Param->OldZ; + + #ifdef USE_LUT + uint8_t j = channels - 1; + #endif + + for (i = 0, data_out_index = 0; i < Param->nSamples; i++, data_out_index += channels) { + #ifdef USE_LUT + Z0 = filter_tables_128[j](Param->lut, data, 0); + Z1 = filter_tables_128[j](Param->lut, data, 1); + Z2 = filter_tables_128[j](Param->lut, data, 2); + #else + Z0 = filter_table(data, 0, Param); + Z1 = filter_table(data, 1, Param); + Z2 = filter_table(data, 2, Param); + #endif + + Z = Param->Coef[1] + Z2 - Param->sub_const; + Param->Coef[1] = Param->Coef[0] + Z1; + Param->Coef[0] = Z0; + + OldOut = (Param->HP_ALFA * (OldOut + Z - OldIn)) >> 8; + OldIn = Z; + OldZ = ((256 - Param->LP_ALFA) * OldZ + Param->LP_ALFA * OldOut) >> 8; + + Z = OldZ * volume; + Z = RoundDiv(Z, (Param->div_const)); + Z = SaturaLH(Z, -32700, 32700); + + dataOut[data_out_index] = Z; + data += data_inc; + } + + Param->OldOut = OldOut; + Param->OldIn = OldIn; + Param->OldZ = OldZ; + return data_out_index; +} +#endif diff --git a/ports/stm/common-hal/audiobusio/OpenPDMFilter.h b/ports/stm/common-hal/audiobusio/OpenPDMFilter.h new file mode 100644 index 0000000000..a6e4a8c063 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/OpenPDMFilter.h @@ -0,0 +1,112 @@ +/** + ******************************************************************************* + * @file OpenPDMFilter.h + * @author CL + * @version V1.0.0 + * @date 9-September-2015 + * @brief Header file for Open PDM audio software decoding Library. + * This Library is used to decode and reconstruct the audio signal + * produced by ST MEMS microphone (MP45Dxxx, MP34Dxxx). + ******************************************************************************* + * @attention + * + *

© COPYRIGHT 2018 STMicroelectronics

+ * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************* + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ + +#ifndef __OPENPDMFILTER_H +#define __OPENPDMFILTER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ + +#include + +/* Definitions ---------------------------------------------------------------*/ + +/* + * Enable to use a Look-Up Table to improve performances while using more FLASH + * and RAM memory. + * Note: Without Look-Up Table up to stereo@16KHz configuration is supported. + */ +#define USE_LUT + +#define SINCN 3 +#define DECIMATION_MAX 128 // can be 128 but this didn't work for me +#define FILTER_GAIN 16 + +#define HTONS(A) ((((uint16_t)(A) & 0xff00) >> 8) | \ + (((uint16_t)(A) & 0x00ff) << 8)) + +#define RoundDiv(a, b) (((a) > 0) ? (((a) + (b) / 2) / (b)) : (((a) - (b) / 2) / (b))) + +#define SaturaLH(N, L, H) (((N) < (L)) ? (L) : (((N) > (H)) ? (H) : (N))) + +/* Types ---------------------------------------------------------------------*/ + +typedef int32_t lut_t[256][DECIMATION_MAX / 8][SINCN]; + + +typedef struct +{ + /* Public */ + uint16_t LP_HZ; + uint16_t HP_HZ; + uint16_t Fs; + unsigned int nSamples; + uint8_t In_MicChannels; + uint8_t Out_MicChannels; + uint8_t Decimation; + uint8_t MaxVolume; + /* Private */ + uint32_t Coef[SINCN]; + uint16_t FilterLen; + int64_t OldOut, OldIn, OldZ; + uint16_t LP_ALFA; + uint16_t HP_ALFA; + uint16_t bit[5]; + uint16_t byte; + uint32_t div_const; + int64_t sub_const; + uint32_t sinc[DECIMATION_MAX * SINCN]; + uint32_t sinc1[DECIMATION_MAX]; + uint32_t sinc2[DECIMATION_MAX * 2]; + uint32_t coef[SINCN][DECIMATION_MAX]; + #ifdef USE_LUT + lut_t lut; + #endif +} TPDMFilter_InitStruct; + +/* Exported functions ------------------------------------------------------- */ + +void Open_PDM_Filter_Init(TPDMFilter_InitStruct *init_struct); +int Open_PDM_Filter_64(uint8_t *data, int16_t *data_out, uint16_t mic_gain, TPDMFilter_InitStruct *init_struct); + +#if DECIMATION_MAX == 128 +int Open_PDM_Filter_128(uint8_t *data, int16_t *data_out, uint16_t mic_gain, TPDMFilter_InitStruct *init_struct); +#endif + +#ifdef __cplusplus +} +#endif + +#endif // __OPENPDMFILTER_H + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/audiobusio/PDMIn.c b/ports/stm/common-hal/audiobusio/PDMIn.c new file mode 100644 index 0000000000..b1aa2047d8 --- /dev/null +++ b/ports/stm/common-hal/audiobusio/PDMIn.c @@ -0,0 +1,199 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Jeff Epler 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 +#include "common-hal/audiobusio/PDMIn.h" +#include "shared-bindings/audiobusio/PDMIn.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "py/runtime.h" +#include "supervisor/memory.h" +#include "MEMS_Audio_ll_stm32l4.h" + + +MemsAudio memsAudio; +MemsAudio_STM32L4SAIPDM memsAudioImpl; +pdm_sample_t pdmBuffer[MEMS_AUDIO_PDM_BUFFER_LENGTH]; +audiobusio_pdmin_obj_t *instance; + +static bool pdm_data_available(MemsAudio_STM32L4SAIPDM *impl, uint8_t *pdmBuffer, size_t pdmBufferLength); + +// Caller validates that pins are free. +void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, + const mcu_pin_obj_t *clock_pin, + const mcu_pin_obj_t *data_pin, + uint32_t sample_rate, + uint8_t bit_depth, + bool mono, + uint8_t oversample) { + self->sample_rate = sample_rate; + self->mono = mono; + self->oversample = oversample; + self->recording_complete = true; + + + if (!mono) { + mp_raise_ValueError(translate("only mono is supported")); + } + if (sample_rate != 16000) { + mp_raise_ValueError(translate("only sample_rate=16000 is supported")); + } + if (bit_depth != 16) { + mp_raise_ValueError(translate("only bit_depth=16 is supported")); + } + if (oversample != 64) { + mp_raise_ValueError(translate("only oversample=64 is supported")); + } + + // wait for the previous instance to finish. + if (instance) { + common_hal_audiobusio_pdmin_deinit(instance); + } + instance = self; + + memset(&memsAudio, 0, sizeof(memsAudio)); + memset(&memsAudioImpl, 0, sizeof(memsAudioImpl)); + + common_hal_mcu_pin_claim(clock_pin); + self->clock_pin = clock_pin; + common_hal_mcu_pin_claim(data_pin); + self->data_pin = data_pin; + + self->audio = &memsAudio; + self->audio_impl = &memsAudioImpl; + self->audio_impl->pdmBuffer = pdmBuffer; + self->audio_impl->pdmBufferLength = sizeof(pdmBuffer) / sizeof(pdmBuffer[0]); + self->audio_impl->pdm_data_available = pdm_data_available; + + mems_audio_init_stm32l4_sai_pdm(self->audio, self->audio_impl); + mems_audio_record(self->audio); + mems_audio_pause(self->audio); +} + +bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t *self) { + return self->clock_pin == NULL; +} + +void wait_dma_complete(audiobusio_pdmin_obj_t *self) { + while (!self->recording_complete) { + MICROPY_VM_HOOK_LOOP; + } +} + +void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t *self) { + if (instance != self) { + return; + } + instance = NULL; + if (self->audio) { + wait_dma_complete(self); + mems_audio_stop(self->audio); + mems_audio_uninit(self->audio); + self->audio = NULL; + self->audio_impl = NULL; + } + + if (self->data_pin) { + common_hal_reset_pin(self->data_pin); + self->data_pin = NULL; + } + if (self->clock_pin) { + common_hal_reset_pin(self->clock_pin); + self->clock_pin = NULL; + } + + +} + +uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t *self) { + return 16; +} + +uint32_t common_hal_audiobusio_pdmin_get_sample_rate(audiobusio_pdmin_obj_t *self) { + return 16000; +} + +static bool pdm_data_available(MemsAudio_STM32L4SAIPDM *impl, uint8_t *pdmBuffer, size_t pdmBufferLength) { + // update the filter with the correct number of samples + + audiobusio_pdmin_obj_t *pdmIn = (audiobusio_pdmin_obj_t *)(impl->audio->userData); + MemsAudio *audio = impl->audio; + + uint32_t pcmSamplesAvailable = pdmBufferLength * 8 / PDM_IN_DECIMATION_FACTOR; + if (pcmSamplesAvailable > audio->pcmOutputBufferLength) { + pcmSamplesAvailable = audio->pcmOutputBufferLength; + } + + // ensure the filter doesn't try to produce more samples than available + pdmIn->audio_impl->filter.nSamples = pcmSamplesAvailable; + + return pcmSamplesAvailable > 0; +} + +static void pcm_data_available(MemsAudio *audio, int16_t *pcmBuffer, size_t pcmBufferLength) { + // data is already in the output buffer + audiobusio_pdmin_obj_t *pdmIn = (audiobusio_pdmin_obj_t *)(audio->userData); + + // if DMA copies more data than will fit into the output buffer, crop the length to what will fit + if (audio->pcmOutputBufferLength < pcmBufferLength) { + pcmBufferLength = audio->pcmOutputBufferLength; + } + + audio->pcmOutputBuffer += pcmBufferLength; + audio->pcmOutputBufferLength -= pcmBufferLength; + if (audio->pcmOutputBufferLength == 0) { + pdmIn->recording_complete = true; + mems_audio_pause(audio); + } +} + +uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t *self, + uint16_t *output_buffer, uint32_t output_buffer_length) { + + MemsAudio *audio = self->audio; + + wait_dma_complete(self); + + audio->pcmOutputBuffer = (int16_t *)output_buffer; + audio->pcmOutputBufferLength = output_buffer_length; + audio->pcm_data_available = pcm_data_available; + audio->userData = self; /// reference back to the PDMIn instance + self->recording_complete = false; + + mems_audio_err_t err = mems_audio_resume(audio); + if (!IS_MEMS_AUDIO_ERROR(err)) { + wait_dma_complete(self); + } + + mems_audio_pause(audio); + int samples_output = (int)(output_buffer_length) - audio->pcmOutputBufferLength; + + // convert from signed to unsigned (min-point moves from 0 to 32k) + for (int i = 0; i < samples_output; i++) { + output_buffer[i] += 0x8000; + } + + return samples_output; +} diff --git a/ports/stm/common-hal/audiobusio/PDMIn.h b/ports/stm/common-hal/audiobusio/PDMIn.h new file mode 100644 index 0000000000..b6ef4ee8bf --- /dev/null +++ b/ports/stm/common-hal/audiobusio/PDMIn.h @@ -0,0 +1,56 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Jeff Epler 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. + */ + +#ifndef MICROPY_INCLUDED_STM_COMMON_HAL_AUDIOBUSIO_AUDIOOUT_H +#define MICROPY_INCLUDED_STM_COMMON_HAL_AUDIOBUSIO_AUDIOOUT_H + +#include +#include "py/obj.h" +#include "peripherals/pins.h" +#include "supervisor/memory.h" + +typedef struct MemsAudio_t MemsAudio; +typedef struct MemsAudio_STM32L4SAIPDM_t MemsAudio_STM32L4SAIPDM; + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t *clock_pin; + const mcu_pin_obj_t *data_pin; + uint32_t sample_rate; + uint8_t bit_depth; + bool mono; + uint8_t oversample; + supervisor_allocation *audio_allocation; + MemsAudio *audio; + MemsAudio_STM32L4SAIPDM *audio_impl; + /** + * @brief Flag to indicate from the ISR that recording is complete. + */ + volatile bool recording_complete; +} audiobusio_pdmin_obj_t; + + +#endif diff --git a/ports/stm/common-hal/audiobusio/__init__.c b/ports/stm/common-hal/audiobusio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 06c568b42e..a5f3296a28 100644 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -58,6 +58,9 @@ enum { #endif + CIRCUITPY_PORT_NUM_SUPERVISOR_ALLOCATIONS + #if CIRCUITPY_AUDIOBUSIO_PDMIN + + 1 + #endif , CIRCUITPY_SUPERVISOR_MOVABLE_ALLOC_COUNT = From 9dc559bb90bcb8ced99014ea8992087dd7c24a07 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 5 Nov 2022 11:50:19 -0500 Subject: [PATCH 047/357] uasyncio: fix definition of ticks again supervisor_ticks_ms is ALREADY a small int, so passing it to MP_OBJ_SMALL_INT again messes things up. I don't know why this passed muster with the C type system, but oh well. --- extmod/moduasyncio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/moduasyncio.c b/extmod/moduasyncio.c index 8af32f21d9..1e1c5de7e7 100644 --- a/extmod/moduasyncio.c +++ b/extmod/moduasyncio.c @@ -83,7 +83,7 @@ STATIC mp_obj_t ticks(void) { // shared-bindings/supervisor/__init__.c). We assume/require that // supervisor.ticks_ms is picked as the ticks implementation under // CircuitPython for the Python-coded bits of asyncio. -#define ticks() MP_OBJ_NEW_SMALL_INT(supervisor_ticks_ms()) +#define ticks() supervisor_ticks_ms() #endif STATIC mp_int_t ticks_diff(mp_obj_t t1_in, mp_obj_t t0_in) { From 452ebe27aec89c973f2b8385729d9ce95b7c026c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 5 Nov 2022 11:24:36 -0500 Subject: [PATCH 048/357] socketpool: make socket objects selectable .. which will lead to them being usable in async contexts, pending relevant changes in asyncio --- .../espressif/common-hal/socketpool/Socket.c | 24 +++++++++++ .../common-hal/socketpool/Socket.c | 43 +++++++++++++++++++ shared-bindings/socketpool/Socket.c | 35 +++++++++++++-- shared-bindings/socketpool/Socket.h | 3 +- 4 files changed, 100 insertions(+), 5 deletions(-) diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index 53db7ab393..ce177f3821 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -553,3 +553,27 @@ mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t *self, void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t *self, uint32_t timeout_ms) { self->timeout_ms = timeout_ms; } + +bool common_hal_socketpool_readable(socketpool_socket_obj_t *self) { + struct timeval immediate = {0, 0}; + + fd_set fds; + FD_ZERO(&fds); + FD_SET(self->num, &fds); + int num_triggered = select(self->num + 1, &fds, NULL, &fds, &immediate); + + // including returning true in the error case + return num_triggered != 0; +} + +bool common_hal_socketpool_writable(socketpool_socket_obj_t *self) { + struct timeval immediate = {0, 0}; + + fd_set fds; + FD_ZERO(&fds); + FD_SET(self->num, &fds); + int num_triggered = select(self->num + 1, NULL, &fds, &fds, &immediate); + + // including returning true in the error case + return num_triggered != 0; +} diff --git a/ports/raspberrypi/common-hal/socketpool/Socket.c b/ports/raspberrypi/common-hal/socketpool/Socket.c index a099ef9f79..440fe56d42 100644 --- a/ports/raspberrypi/common-hal/socketpool/Socket.c +++ b/ports/raspberrypi/common-hal/socketpool/Socket.c @@ -1163,3 +1163,46 @@ mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t *socket, void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t *self, uint32_t timeout_ms) { self->timeout = timeout_ms; } + +bool common_hal_socketpool_readable(socketpool_socket_obj_t *self) { + + MICROPY_PY_LWIP_ENTER; + + bool result = self->incoming.pbuf != NULL; + + if (self->state == STATE_PEER_CLOSED) { + result = true; + } + + if (self->type == SOCKETPOOL_SOCK_STREAM && self->pcb.tcp->state == LISTEN) { + struct tcp_pcb *volatile *incoming_connection = &lwip_socket_incoming_array(self)[self->incoming.connection.iget]; + result = (incoming_connection != NULL); + } + + MICROPY_PY_LWIP_EXIT; + + return result; +} + +bool common_hal_socketpool_writable(socketpool_socket_obj_t *self) { + bool result = false; + + MICROPY_PY_LWIP_ENTER; + + switch (self->type) { + case SOCKETPOOL_SOCK_STREAM: { + result = tcp_sndbuf(self->pcb.tcp) != 0; + break; + } + case SOCKETPOOL_SOCK_DGRAM: + #if MICROPY_PY_LWIP_SOCK_RAW + case SOCKETPOOL_SOCK_RAW: + #endif + result = true; + break; + } + + MICROPY_PY_LWIP_EXIT; + + return result; +} diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index 89b23125c5..7a60463c4b 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -30,13 +30,14 @@ #include #include -#include "shared/runtime/context_manager_helpers.h" -#include "py/objtuple.h" -#include "py/objlist.h" -#include "py/runtime.h" #include "py/mperrno.h" +#include "py/objlist.h" +#include "py/objtuple.h" +#include "py/runtime.h" +#include "py/stream.h" #include "shared/netutils/netutils.h" +#include "shared/runtime/context_manager_helpers.h" #include "shared/runtime/interrupt_char.h" //| class Socket: @@ -422,6 +423,31 @@ STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(socketpool_socket_locals_dict, socketpool_socket_locals_dict_table); +STATIC mp_uint_t socket_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t arg, int *errcode) { + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_uint_t ret; + if (request == MP_STREAM_POLL) { + mp_uint_t flags = arg; + ret = 0; + if ((flags & MP_STREAM_POLL_RD) && common_hal_socketpool_readable(self) > 0) { + ret |= MP_STREAM_POLL_RD; + } + if ((flags & MP_STREAM_POLL_WR) && common_hal_socketpool_writable(self)) { + ret |= MP_STREAM_POLL_WR; + } + } else { + *errcode = MP_EINVAL; + ret = MP_STREAM_ERROR; + } + return ret; +} + +STATIC const mp_stream_p_t socket_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) + .ioctl = socket_ioctl, + .is_text = false, +}; + const mp_obj_type_t socketpool_socket_type = { { &mp_type_type }, .flags = MP_TYPE_FLAG_EXTENDED, @@ -429,5 +455,6 @@ const mp_obj_type_t socketpool_socket_type = { .locals_dict = (mp_obj_dict_t *)&socketpool_socket_locals_dict, MP_TYPE_EXTENDED_FIELDS( .unary_op = mp_generic_unary_op, + .protocol = &socket_stream_p, ) }; diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index c6c2a66630..cf5a97a428 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -46,6 +46,8 @@ mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t *self, const mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t *self, const char *host, size_t hostlen, uint32_t port, const uint8_t *buf, uint32_t len); void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t *self, uint32_t timeout_ms); +bool common_hal_socketpool_readable(socketpool_socket_obj_t *self); +bool common_hal_socketpool_writable(socketpool_socket_obj_t *self); // Non-allocating versions for internal use. int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port); @@ -53,5 +55,4 @@ void socketpool_socket_close(socketpool_socket_obj_t *self); int socketpool_socket_send(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len); int socketpool_socket_recv_into(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len); - #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H From 2c2c9153ec7c24975048d90bd457138de4ee5f1a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 5 Nov 2022 11:33:47 -0500 Subject: [PATCH 049/357] uselect: Allow interrupting poll with ctrl-c --- extmod/moduselect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extmod/moduselect.c b/extmod/moduselect.c index 5744d2839c..d388438313 100644 --- a/extmod/moduselect.c +++ b/extmod/moduselect.c @@ -16,6 +16,7 @@ #include "py/stream.h" #include "py/mperrno.h" #include "py/mphal.h" +#include "shared/runtime/interrupt_char.h" // Flags for poll() #define FLAG_ONESHOT (1) @@ -230,6 +231,9 @@ STATIC mp_uint_t poll_poll_internal(uint n_args, const mp_obj_t *args) { break; } RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + return 0; + } } return n_ready; From f1e658f8bb312c41fdd2fa64094e5b2413c9939c Mon Sep 17 00:00:00 2001 From: dronecz Date: Sun, 6 Nov 2022 22:07:12 +0100 Subject: [PATCH 050/357] Update sdkonfig --- ports/espressif/boards/maker_badge/sdkonfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/maker_badge/sdkonfig b/ports/espressif/boards/maker_badge/sdkonfig index 5a33657fdc..68689ed79e 100644 --- a/ports/espressif/boards/maker_badge/sdkonfig +++ b/ports/espressif/boards/maker_badge/sdkonfig @@ -2,5 +2,5 @@ CONFIG_ESP32S2_SPIRAM_SUPPORT=n # LWIP # -CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +CONFIG_LWIP_LOCAL_HOSTNAME="Maker_badge" # end of LWIP From a568a5c2e25bb873f183633befe22f082a48801b Mon Sep 17 00:00:00 2001 From: dronecz Date: Sun, 6 Nov 2022 22:14:19 +0100 Subject: [PATCH 051/357] Rename sdkonfig to sdkconfig --- ports/espressif/boards/maker_badge/{sdkonfig => sdkconfig} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ports/espressif/boards/maker_badge/{sdkonfig => sdkconfig} (100%) diff --git a/ports/espressif/boards/maker_badge/sdkonfig b/ports/espressif/boards/maker_badge/sdkconfig similarity index 100% rename from ports/espressif/boards/maker_badge/sdkonfig rename to ports/espressif/boards/maker_badge/sdkconfig From 9cdfba2e47ff148439e9c03dc5298ce5364bc691 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 7 Nov 2022 09:47:56 -0600 Subject: [PATCH 052/357] Simplify argument checking to reduce translated strings Build size on proxlight trinkey m0 en_US: Before: 2412 (en_US) 820 (ru) After: 2544 (en_US) 984 (ru) Savings: +132 (en_US) +164 (ru) bytes available flash --- locale/circuitpython.pot | 44 ++---------------------- py/obj.c | 26 ++------------ py/objstr.c | 4 +-- py/objtype.c | 4 +-- shared-bindings/busio/UART.c | 4 +-- shared-bindings/touchio/TouchIn.c | 5 +-- shared-bindings/usb_hid/__init__.c | 4 +-- shared-bindings/watchdog/WatchDogTimer.c | 8 ++--- 8 files changed, 13 insertions(+), 86 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 768daa8651..779a75deb6 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -110,10 +110,6 @@ msgstr "" msgid "%q index out of range" msgstr "" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2341,10 +2337,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3166,10 +3158,6 @@ msgstr "" msgid "index out of range" msgstr "" -#: py/obj.c -msgid "indices must be integers" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3586,10 +3574,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3863,11 +3847,6 @@ msgstr "" msgid "relative import" msgstr "" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3931,10 +3910,6 @@ msgstr "" msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4047,10 +4022,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4062,10 +4033,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4119,10 +4086,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4201,7 +4164,8 @@ msgid "unknown type '%q'" msgstr "" #: py/objstr.c -msgid "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" msgstr "" #: py/objtype.c py/runtime.c @@ -4272,10 +4236,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" diff --git a/py/obj.c b/py/obj.c index da609aa8ce..af2f4c1b68 100644 --- a/py/obj.c +++ b/py/obj.c @@ -488,14 +488,7 @@ void mp_obj_get_array(mp_obj_t o, size_t *len, mp_obj_t **items) { void mp_obj_get_array_fixed_n(mp_obj_t o, size_t len, mp_obj_t **items) { size_t seq_len; mp_obj_get_array(o, &seq_len, items); - if (seq_len != len) { - #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE - mp_raise_ValueError(MP_ERROR_TEXT("tuple/list has wrong length")); - #else - mp_raise_ValueError_varg( - MP_ERROR_TEXT("requested length %d but object has length %d"), (int)len, (int)seq_len); - #endif - } + mp_arg_validate_length(seq_len, len, mp_obj_get_type(o)->name); } // is_slice determines whether the index is a slice index @@ -504,13 +497,7 @@ size_t mp_get_index(const mp_obj_type_t *type, size_t len, mp_obj_t index, bool if (mp_obj_is_small_int(index)) { i = MP_OBJ_SMALL_INT_VALUE(index); } else if (!mp_obj_get_int_maybe(index, &i)) { - #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE - mp_raise_TypeError(MP_ERROR_TEXT("indices must be integers")); - #else - mp_raise_TypeError_varg( - MP_ERROR_TEXT("%q indices must be integers, not %s"), - type->name, mp_obj_get_type_str(index)); - #endif + mp_raise_TypeError_varg(translate("%q must be of type %q"), MP_QSTR_index, MP_QSTR_int); } if (i < 0) { @@ -523,14 +510,7 @@ size_t mp_get_index(const mp_obj_type_t *type, size_t len, mp_obj_t index, bool i = len; } } else { - if (i < 0 || (mp_uint_t)i >= len) { - #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE - mp_raise_IndexError(MP_ERROR_TEXT("index out of range")); - #else - mp_raise_msg_varg(&mp_type_IndexError, - MP_ERROR_TEXT("%q index out of range"), type->name); - #endif - } + mp_arg_validate_index_range(i, 0, len - 1, MP_QSTR_index); } // By this point 0 <= i <= len and so fits in a size_t diff --git a/py/objstr.c b/py/objstr.c index df735a45cd..fbb044c65e 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -986,7 +986,7 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); #else - mp_raise_ValueError(MP_ERROR_TEXT("single '}' encountered in format string")); + mp_raise_ValueError_varg(MP_ERROR_TEXT("unmatched '%c' in format"), '}'); #endif } if (*str != '{') { @@ -1063,7 +1063,7 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE terse_str_format_value_error(); #else - mp_raise_ValueError(MP_ERROR_TEXT("unmatched '{' in format")); + mp_raise_ValueError_varg(MP_ERROR_TEXT("unmatched '%c' in format"), '{'); #endif } if (*str != '}') { diff --git a/py/objtype.c b/py/objtype.c index 071065041f..0914ad5f2e 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -1181,9 +1181,7 @@ mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict) mp_obj_t *bases_items; mp_obj_tuple_get(bases_tuple, &bases_len, &bases_items); for (size_t i = 0; i < bases_len; i++) { - if (!mp_obj_is_type(bases_items[i], &mp_type_type)) { - mp_raise_TypeError(MP_ERROR_TEXT("type is not an acceptable base type")); - } + mp_arg_validate_type(bases_items[i], &mp_type_type, MP_QSTR___class__); mp_obj_type_t *t = MP_OBJ_TO_PTR(bases_items[i]); // TODO: Verify with CPy, tested on function type if (t->make_new == NULL) { diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index eb4f15afe5..eb1d1685a5 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -91,9 +91,7 @@ extern const busio_uart_parity_obj_t busio_uart_parity_odd_obj; #if CIRCUITPY_BUSIO_UART STATIC void validate_timeout(mp_float_t timeout) { - if (timeout < (mp_float_t)0.0f || timeout > (mp_float_t)100.0f) { - mp_raise_ValueError(translate("timeout must be 0.0-100.0 seconds")); - } + mp_arg_validate_int_range((int)timeout, 0, 100, MP_QSTR_timeout); } #endif // CIRCUITPY_BUSIO_UART diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 63da84e885..226fa445da 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -159,10 +159,7 @@ STATIC mp_obj_t touchio_touchin_obj_set_threshold(mp_obj_t self_in, mp_obj_t thr touchio_touchin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); uint32_t new_threshold = mp_obj_get_int(threshold_obj); - if (new_threshold < 0 || new_threshold > UINT16_MAX) { - // I would use MP_STRINGIFY(UINT16_MAX), but that prints "0xffff" instead of 65536. - mp_raise_ValueError(translate("threshold must be in the range 0-65536")); - } + mp_arg_validate_int_range(new_threshold, 0, UINT16_MAX, MP_QSTR_threshold); common_hal_touchio_touchin_set_threshold(self, new_threshold); return mp_const_none; } diff --git a/shared-bindings/usb_hid/__init__.c b/shared-bindings/usb_hid/__init__.c index 1c51502455..9cb9303143 100644 --- a/shared-bindings/usb_hid/__init__.c +++ b/shared-bindings/usb_hid/__init__.c @@ -123,9 +123,7 @@ STATIC mp_obj_t usb_hid_enable(size_t n_args, const mp_obj_t *pos_args, mp_map_t const mp_int_t len = mp_obj_get_int(mp_obj_len(devices)); for (mp_int_t i = 0; i < len; i++) { mp_obj_t item = mp_obj_subscr(devices, MP_OBJ_NEW_SMALL_INT(i), MP_OBJ_SENTINEL); - if (!mp_obj_is_type(item, &usb_hid_device_type)) { - mp_raise_ValueError_varg(translate("non-Device in %q"), MP_QSTR_devices); - } + mp_arg_validate_type(item, &usb_hid_device_type, MP_QSTR___class__); } uint8_t boot_device = diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index 1d47e88b9f..acfd353c34 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -94,9 +94,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_ watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); mp_float_t timeout = mp_obj_get_float(timeout_obj); - if (timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } + mp_arg_validate_int_min((int)timeout, 0, MP_QSTR_timeout); common_hal_watchdog_set_timeout(self, timeout); return mp_const_none; @@ -136,9 +134,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m // When setting the mode, the timeout value must be greater than zero if (new_mode == WATCHDOGMODE_RESET || new_mode == WATCHDOGMODE_RAISE) { - if (current_timeout <= 0) { - mp_raise_ValueError(translate("WatchDogTimer.timeout must be greater than 0")); - } + mp_arg_validate_int_min((int)current_timeout, 0, MP_QSTR_timeout); } // Don't allow changing the mode once the watchdog timer has been started From 319d9b04f13389bdc6469fe19771125f2b4ef719 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 7 Nov 2022 13:51:58 -0600 Subject: [PATCH 053/357] Fix type annotation mistake --- shared-bindings/terminalio/Terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index 2dfe29035e..46e171ff7e 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -61,7 +61,7 @@ //| scroll_area: displayio.TileGrid, //| font: fontio.BuiltinFont, //| *, -//| status_bar: displayio.TileGrid = None +//| status_bar: Optional[displayio.TileGrid] = None //| ) -> None: //| """Terminal manages tile indices and cursor position based on VT100 commands. The font should be //| a `fontio.BuiltinFont` and the TileGrid's bitmap should match the font's bitmap.""" From 9f3d3ed9b07fc7bc924627e5b7425c74f162fdb9 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 8 Nov 2022 00:29:35 +0100 Subject: [PATCH 054/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 47 +++-------------------- locale/cs.po | 47 +++-------------------- locale/de_DE.po | 80 +++++++++++++++++++--------------------- locale/el.po | 47 +++-------------------- locale/en_GB.po | 80 +++++++++++++++++++--------------------- locale/es.po | 80 +++++++++++++++++++--------------------- locale/fil.po | 68 +++++++++++++--------------------- locale/fr.po | 80 +++++++++++++++++++--------------------- locale/hi.po | 44 +--------------------- locale/it_IT.po | 68 +++++++++++++--------------------- locale/ja.po | 74 ++++++++++++++++--------------------- locale/ko.po | 47 +++-------------------- locale/nl.po | 77 +++++++++++++++++--------------------- locale/pl.po | 71 ++++++++++++++--------------------- locale/pt_BR.po | 80 +++++++++++++++++++--------------------- locale/ru.po | 47 +++-------------------- locale/sv.po | 80 +++++++++++++++++++--------------------- locale/tr.po | 47 +++-------------------- locale/zh_Latn_pinyin.po | 80 +++++++++++++++++++--------------------- 19 files changed, 434 insertions(+), 810 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 6741923b7d..85089303e3 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -116,10 +116,6 @@ msgstr "%q sedang digunakan" msgid "%q index out of range" msgstr "%q indeks di luar batas" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "indeks %q harus bilangan bulat, bukan %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2372,10 +2368,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3197,10 +3189,6 @@ msgstr "" msgid "index out of range" msgstr "index keluar dari jangkauan" -#: py/obj.c -msgid "indices must be integers" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3617,10 +3605,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3895,11 +3879,6 @@ msgstr "" msgid "relative import" msgstr "relative import" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3963,10 +3942,6 @@ msgstr "" msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4079,10 +4054,6 @@ msgstr "sintaksis error pada JSON" msgid "syntax error in uctypes descriptor" msgstr "sintaksis error pada pendeskripsi uctypes" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4094,10 +4065,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4151,10 +4118,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4233,7 +4196,8 @@ msgid "unknown type '%q'" msgstr "" #: py/objstr.c -msgid "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" msgstr "" #: py/objtype.c py/runtime.c @@ -4304,10 +4268,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4395,6 +4355,9 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "indeks %q harus bilangan bulat, bukan %s" + #~ msgid "To exit, please reset the board without " #~ msgstr "Untuk keluar, silahkan reset board tanpa " diff --git a/locale/cs.po b/locale/cs.po index 9159489fe5..c0a27df166 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -117,10 +117,6 @@ msgstr "%q se právě používá" msgid "%q index out of range" msgstr "Index %q je mimo rozsah" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "Indexy %q musí být celá čísla, nikoli %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "Inicializace %q selhala" @@ -2359,10 +2355,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3184,10 +3176,6 @@ msgstr "" msgid "index out of range" msgstr "" -#: py/obj.c -msgid "indices must be integers" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3604,10 +3592,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3881,11 +3865,6 @@ msgstr "" msgid "relative import" msgstr "" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3949,10 +3928,6 @@ msgstr "" msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4065,10 +4040,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4080,10 +4051,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4137,10 +4104,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4219,7 +4182,8 @@ msgid "unknown type '%q'" msgstr "" #: py/objstr.c -msgid "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" msgstr "" #: py/objtype.c py/runtime.c @@ -4290,10 +4254,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4381,6 +4341,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "Indexy %q musí být celá čísla, nikoli %s" + #~ msgid "Firmware image is invalid" #~ msgstr "Obraz firmwaru je nevalidní" diff --git a/locale/de_DE.po b/locale/de_DE.po index 6fc8b9758b..17676cfa51 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -118,10 +118,6 @@ msgstr "%q in Benutzung" msgid "%q index out of range" msgstr "Der Index %q befindet sich außerhalb des Bereiches" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q Indizes müssen Integer sein, nicht %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "%q Initialisierung ist gescheitert" @@ -2406,10 +2402,6 @@ msgstr "" "WatchDogTimer.mode kann nicht geändert werden, nachdem er auf WatchDogMode." "RESET gesetzt wurde" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.timeout muss größer als 0 sein" - #: py/builtinhelp.c #, c-format msgid "" @@ -3254,10 +3246,6 @@ msgstr "Index ist außerhalb der Grenzen" msgid "index out of range" msgstr "index außerhalb der Reichweite" -#: py/obj.c -msgid "indices must be integers" -msgstr "Indizes müssen Integer sein" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" @@ -3680,10 +3668,6 @@ msgstr "keine Antwort von der SD-Karte" msgid "no such attribute" msgstr "kein solches Attribut" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "Nicht-Gerät in %q" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3962,11 +3946,6 @@ msgstr "Real- und Imaginärteile müssen gleich lang sein" msgid "relative import" msgstr "relativer Import" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "die ersuchte Länge ist %d, aber das Objekt hat eine Länge von %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "Ergebnisse können nicht in den angegebenen Typ umgewandelt werden" @@ -4030,10 +4009,6 @@ msgstr "Vorzeichen nicht erlaubt in einem String formatierungs specifier" msgid "sign not allowed with integer format specifier 'c'" msgstr "Vorzeichen mit ganzzahligem Formatbezeichner 'c' nicht erlaubt" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "einzelne '}' in Formatierungs-String gefunden" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "Größe ist nur für ndarrays definiert" @@ -4147,10 +4122,6 @@ msgstr "Syntaxfehler in JSON" msgid "syntax error in uctypes descriptor" msgstr "Syntaxfehler in uctypes Deskriptor" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "threshold muss im Intervall 0-65536 liegen" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() nimmt eine 9-Sequenz an" @@ -4162,10 +4133,6 @@ msgstr "time.struct_time() nimmt eine 9-Sequenz an" msgid "timeout duration exceeded the maximum supported value" msgstr "Das Zeitlimit hat den maximal zulässigen Wert überschritten" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "timeout muss kleiner als 655.35 Sekunden sein" @@ -4219,10 +4186,6 @@ msgstr "trapz ist für 1D-Arrays gleicher Länge definiert" msgid "trapz is defined for 1D iterables" msgstr "trapz ist für 1D-Iterables definiert" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "tupel/list hat falsche Länge" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4303,8 +4266,9 @@ msgid "unknown type '%q'" msgstr "unbekannter Typ '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "'{' ohne passende Zuordnung im Format" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4374,10 +4338,6 @@ msgstr "value_count muss größer als 0 sein" msgid "watchdog not initialized" msgstr "watchdog nicht initialisiert" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "watchdog Zeitlimit muss größer als 0 sein" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "Breite muss größer als 0 sein" @@ -4465,6 +4425,40 @@ 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 "%q indices must be integers, not %s" +#~ msgstr "%q Indizes müssen Integer sein, nicht %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.timeout muss größer als 0 sein" + +#~ msgid "indices must be integers" +#~ msgstr "Indizes müssen Integer sein" + +#~ msgid "non-Device in %q" +#~ msgstr "Nicht-Gerät in %q" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "die ersuchte Länge ist %d, aber das Objekt hat eine Länge von %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "einzelne '}' in Formatierungs-String gefunden" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "threshold muss im Intervall 0-65536 liegen" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "tupel/list hat falsche Länge" + +#~ msgid "unmatched '{' in format" +#~ msgstr "'{' ohne passende Zuordnung im Format" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "watchdog Zeitlimit muss größer als 0 sein" + #~ msgid "To exit, please reset the board without " #~ msgstr "Zum beenden, resette bitte das board ohne " diff --git a/locale/el.po b/locale/el.po index 59e69f257f..6441c013b8 100644 --- a/locale/el.po +++ b/locale/el.po @@ -122,10 +122,6 @@ msgstr "%q είναι σε χρήση" msgid "%q index out of range" msgstr "%q δείκτης εκτός εμβέλειας" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q δείκτες πρέπει να είναι ακέραιοι, όχι %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "%q εκκίνηση απέτυχε" @@ -2368,10 +2364,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3193,10 +3185,6 @@ msgstr "" msgid "index out of range" msgstr "" -#: py/obj.c -msgid "indices must be integers" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3613,10 +3601,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3890,11 +3874,6 @@ msgstr "" msgid "relative import" msgstr "" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3958,10 +3937,6 @@ msgstr "" msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4074,10 +4049,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4089,10 +4060,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4146,10 +4113,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4228,7 +4191,8 @@ msgid "unknown type '%q'" msgstr "" #: py/objstr.c -msgid "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" msgstr "" #: py/objtype.c py/runtime.c @@ -4299,10 +4263,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4390,6 +4350,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q δείκτες πρέπει να είναι ακέραιοι, όχι %s" + #~ msgid "%q must be >= 0" #~ msgstr "%q πρέπει να είναι >= 0" diff --git a/locale/en_GB.po b/locale/en_GB.po index 7b111a211a..f2941c143e 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -120,10 +120,6 @@ msgstr "%q in use" msgid "%q index out of range" msgstr "%q index out of range" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q indices must be integers, not %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2374,10 +2370,6 @@ msgstr "WatchDogTimer is not currently running" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.timeout must be greater than 0" - #: py/builtinhelp.c #, c-format msgid "" @@ -3203,10 +3195,6 @@ msgstr "index is out of bounds" msgid "index out of range" msgstr "index out of range" -#: py/obj.c -msgid "indices must be integers" -msgstr "indices must be integers" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "indices must be integers, slices, or Boolean lists" @@ -3623,10 +3611,6 @@ msgstr "no response from SD card" msgid "no such attribute" msgstr "no such attribute" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "non-Device in %q" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3900,11 +3884,6 @@ msgstr "real and imaginary parts must be of equal length" msgid "relative import" msgstr "relative import" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "requested length %d but object has length %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "results cannot be cast to specified type" @@ -3968,10 +3947,6 @@ msgstr "sign not allowed in string format specifier" msgid "sign not allowed with integer format specifier 'c'" msgstr "sign not allowed with integer format specifier 'c'" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "single '}' encountered in format string" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "size is defined for ndarrays only" @@ -4084,10 +4059,6 @@ msgstr "syntax error in JSON" msgid "syntax error in uctypes descriptor" msgstr "syntax error in uctypes descriptor" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "threshold must be in the range 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() takes a 9-sequence" @@ -4099,10 +4070,6 @@ msgstr "time.struct_time() takes a 9-sequence" msgid "timeout duration exceeded the maximum supported value" msgstr "timeout duration exceeded the maximum supported value" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "timeout must be 0.0-100.0 seconds" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "timeout must be < 655.35 secs" @@ -4156,10 +4123,6 @@ msgstr "trapz is defined for 1D arrays of equal length" msgid "trapz is defined for 1D iterables" msgstr "trapz is defined for 1D iterables" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "tuple/list has wrong length" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4238,8 +4201,9 @@ msgid "unknown type '%q'" msgstr "unknown type '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4309,10 +4273,6 @@ msgstr "value_count must be > 0" msgid "watchdog not initialized" msgstr "WatchDog not initialised" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "WatchDog timeout must be greater than 0" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "width must be greater than zero" @@ -4400,6 +4360,40 @@ 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 "%q indices must be integers, not %s" +#~ msgstr "%q indices must be integers, not %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.timeout must be greater than 0" + +#~ msgid "indices must be integers" +#~ msgstr "indices must be integers" + +#~ msgid "non-Device in %q" +#~ msgstr "non-Device in %q" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "requested length %d but object has length %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "single '}' encountered in format string" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "threshold must be in the range 0-65536" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "timeout must be 0.0-100.0 seconds" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "tuple/list has wrong length" + +#~ msgid "unmatched '{' in format" +#~ msgstr "unmatched '{' in format" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "WatchDog timeout must be greater than 0" + #~ msgid "To exit, please reset the board without " #~ msgstr "To exit, please reset the board without " diff --git a/locale/es.po b/locale/es.po index 5f3837732f..477c7804d0 100644 --- a/locale/es.po +++ b/locale/es.po @@ -122,10 +122,6 @@ msgstr "%q está siendo utilizado" msgid "%q index out of range" msgstr "%q indice fuera de rango" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q indices deben ser enteros, no %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "%q inicializado fallido" @@ -2409,10 +2405,6 @@ msgstr "" "WatchDogTimer.mode no se puede modificar luego de configurar WatchDogMode." "RESET" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.timeout debe ser mayor a 0" - #: py/builtinhelp.c #, c-format msgid "" @@ -3243,10 +3235,6 @@ msgstr "el índice está fuera de límites" msgid "index out of range" msgstr "index fuera de rango" -#: py/obj.c -msgid "indices must be integers" -msgstr "indices deben ser enteros" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "los índices deben ser enteros, particiones o listas de booleanos" @@ -3667,10 +3655,6 @@ msgstr "no hay respuesta de la tarjeta SD" msgid "no such attribute" msgstr "no hay tal atributo" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "hay un no-Device en %q" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3947,11 +3931,6 @@ msgstr "las partes reales e imaginarias deben ser de igual longitud" msgid "relative import" msgstr "import relativo" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "longitud solicitada %d pero el objeto tiene longitud %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "resultados no pueden aplicar cast a un tipo específico" @@ -4015,10 +3994,6 @@ msgstr "signo no permitido en el espeficador de string format" msgid "sign not allowed with integer format specifier 'c'" msgstr "signo no permitido con el especificador integer format 'c'" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "un solo '}' encontrado en format string" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "el tamaño se define solo para ndarrays" @@ -4131,10 +4106,6 @@ msgstr "error de sintaxis en JSON" msgid "syntax error in uctypes descriptor" msgstr "error de sintaxis en el descriptor uctypes" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "limite debe ser en el rango 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" @@ -4147,10 +4118,6 @@ msgid "timeout duration exceeded the maximum supported value" msgstr "" "la duración de tiempo de espera ha excedido la capacidad máxima del valor" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "el tiempo de espera debe ser 0.0-100.0 segundos" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "timeout debe ser < 655.35 segundos" @@ -4204,10 +4171,6 @@ msgstr "trapz está definido para arreglos 1D de igual tamaño" msgid "trapz is defined for 1D iterables" msgstr "trapz está definido para iterables 1D" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "tupla/lista tiene una longitud incorrecta" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4286,8 +4249,9 @@ msgid "unknown type '%q'" msgstr "tipo desconocido '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "No coinciden '{' en format" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4357,10 +4321,6 @@ msgstr "value_count debe ser > 0" msgid "watchdog not initialized" msgstr "watchdog no inicializado" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "el ancho debe ser mayor que cero" @@ -4448,6 +4408,40 @@ 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 "%q indices must be integers, not %s" +#~ msgstr "%q indices deben ser enteros, no %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.timeout debe ser mayor a 0" + +#~ msgid "indices must be integers" +#~ msgstr "indices deben ser enteros" + +#~ msgid "non-Device in %q" +#~ msgstr "hay un no-Device en %q" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "longitud solicitada %d pero el objeto tiene longitud %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "un solo '}' encontrado en format string" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "limite debe ser en el rango 0-65536" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "el tiempo de espera debe ser 0.0-100.0 segundos" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "tupla/lista tiene una longitud incorrecta" + +#~ msgid "unmatched '{' in format" +#~ msgstr "No coinciden '{' en format" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" + #~ msgid "To exit, please reset the board without " #~ msgstr "Para salir, por favor reinicia la tarjeta sin " diff --git a/locale/fil.po b/locale/fil.po index 9391a5f697..e6f7823269 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -111,10 +111,6 @@ msgstr "%q ay ginagamit" msgid "%q index out of range" msgstr "%q indeks wala sa sakop" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q indeks ay dapat integers, hindi %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2360,10 +2356,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3197,10 +3189,6 @@ msgstr "" msgid "index out of range" msgstr "index wala sa sakop" -#: py/obj.c -msgid "indices must be integers" -msgstr "ang mga indeks ay dapat na integer" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3621,10 +3609,6 @@ msgstr "" msgid "no such attribute" msgstr "walang ganoon na attribute" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3900,11 +3884,6 @@ msgstr "" msgid "relative import" msgstr "relative import" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "hiniling ang haba %d ngunit may haba ang object na %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3968,10 +3947,6 @@ msgstr "sign hindi maaring string format specifier" msgid "sign not allowed with integer format specifier 'c'" msgstr "sign hindi maari sa integer format specifier 'c'" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "isang '}' nasalubong sa format string" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4084,10 +4059,6 @@ msgstr "sintaks error sa JSON" msgid "syntax error in uctypes descriptor" msgstr "may pagkakamali sa sintaks sa uctypes descriptor" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "ang threshold ay dapat sa range 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" @@ -4099,10 +4070,6 @@ msgstr "time.struct_time() kumukuha ng 9-sequence" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4156,10 +4123,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "mali ang haba ng tuple/list" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4238,8 +4201,9 @@ msgid "unknown type '%q'" msgstr "hindi malaman ang type '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "hindi tugma ang '{' sa format" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4309,10 +4273,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4402,6 +4362,28 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q indeks ay dapat integers, hindi %s" + +#~ msgid "indices must be integers" +#~ msgstr "ang mga indeks ay dapat na integer" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "hiniling ang haba %d ngunit may haba ang object na %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "isang '}' nasalubong sa format string" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "ang threshold ay dapat sa range 0-65536" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "mali ang haba ng tuple/list" + +#~ msgid "unmatched '{' in format" +#~ msgstr "hindi tugma ang '{' sa format" + #~ msgid "To exit, please reset the board without " #~ msgstr "Para lumabas, paki-reset ang board na wala ang " diff --git a/locale/fr.po b/locale/fr.po index 9eb7bba7bd..0bba3c5c6a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -122,10 +122,6 @@ msgstr "%q en cours d'utilisation" msgid "%q index out of range" msgstr "index %q hors de portée" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "les indices %q doivent être des entiers, pas %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "échec de l'initialisation %q" @@ -2435,10 +2431,6 @@ msgstr "" "WatchDogTimer.mode ne peut pas être changé une fois réglé à WatchDogMode." "RESET" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.timeout doit être supérieur à 0" - #: py/builtinhelp.c #, c-format msgid "" @@ -3280,10 +3272,6 @@ msgstr "l'index est hors limites" msgid "index out of range" msgstr "index est hors bornes" -#: py/obj.c -msgid "indices must be integers" -msgstr "les indices doivent être des entiers" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3707,10 +3695,6 @@ msgstr "pas de réponse de la carte SD" msgid "no such attribute" msgstr "pas de tel attribut" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "aucun appareil dans %q" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3989,11 +3973,6 @@ msgstr "les parties réelles et imaginaires doivent être de longueur égale" msgid "relative import" msgstr "import relatif" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "la longueur requise est %d mais l'objet est long de %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "résultats ne peuvent être transformé au type spécifié" @@ -4057,10 +4036,6 @@ msgstr "signe non autorisé dans les spéc. de formats de chaînes de caractère msgid "sign not allowed with integer format specifier 'c'" msgstr "signe non autorisé avec la spéc. de format d'entier 'c'" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "'}' seule rencontrée dans une chaîne de format" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "la taille n'est définie que pour les ndarrays" @@ -4174,10 +4149,6 @@ msgstr "erreur de syntaxe JSON" msgid "syntax error in uctypes descriptor" msgstr "erreur de syntaxe dans le descripteur d'uctypes" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "le seuil doit être dans la portée 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() prend une séquence de longueur 9" @@ -4189,10 +4160,6 @@ msgstr "time.struct_time() prend une séquence de longueur 9" msgid "timeout duration exceeded the maximum supported value" msgstr "le délai d'expiration a dépassé la valeur maximale prise en charge" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "le délai doit être compris entre 0.0 et 100.0 secondes" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "le délai (timeout) doit être < 655.35 secondes" @@ -4246,10 +4213,6 @@ msgstr "trapz n'est défini que pour des matrices 1D de longueur égales" msgid "trapz is defined for 1D iterables" msgstr "trapz est défini pour les 1D itérables" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "tuple/liste a une mauvaise longueur" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4328,8 +4291,9 @@ msgid "unknown type '%q'" msgstr "type '%q' inconnu" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "'{' sans correspondance dans le format" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4399,10 +4363,6 @@ msgstr "'value_count' doit être > 0" msgid "watchdog not initialized" msgstr "chien de garde (watchdog) non initialisé" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "watchdog timeout doit être supérieur à 0" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "width doit être plus que zero" @@ -4490,6 +4450,40 @@ 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 "%q indices must be integers, not %s" +#~ msgstr "les indices %q doivent être des entiers, pas %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.timeout doit être supérieur à 0" + +#~ msgid "indices must be integers" +#~ msgstr "les indices doivent être des entiers" + +#~ msgid "non-Device in %q" +#~ msgstr "aucun appareil dans %q" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "la longueur requise est %d mais l'objet est long de %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "'}' seule rencontrée dans une chaîne de format" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "le seuil doit être dans la portée 0-65536" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "le délai doit être compris entre 0.0 et 100.0 secondes" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "tuple/liste a une mauvaise longueur" + +#~ msgid "unmatched '{' in format" +#~ msgstr "'{' sans correspondance dans le format" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "watchdog timeout doit être supérieur à 0" + #~ msgid "To exit, please reset the board without " #~ msgstr "Pour quitter, SVP redémarrez la carte sans " diff --git a/locale/hi.po b/locale/hi.po index cde333382b..af78de1e3b 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -110,10 +110,6 @@ msgstr "" msgid "%q index out of range" msgstr "" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2341,10 +2337,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3166,10 +3158,6 @@ msgstr "" msgid "index out of range" msgstr "" -#: py/obj.c -msgid "indices must be integers" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3586,10 +3574,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3863,11 +3847,6 @@ msgstr "" msgid "relative import" msgstr "" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3931,10 +3910,6 @@ msgstr "" msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4047,10 +4022,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4062,10 +4033,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4119,10 +4086,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4201,7 +4164,8 @@ msgid "unknown type '%q'" msgstr "" #: py/objstr.c -msgid "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" msgstr "" #: py/objtype.c py/runtime.c @@ -4272,10 +4236,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index dc688a83a9..09d98d9ae5 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -117,10 +117,6 @@ msgstr "%q in uso" msgid "%q index out of range" msgstr "indice %q fuori intervallo" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "gli indici %q devono essere interi, non %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2370,10 +2366,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3205,10 +3197,6 @@ msgstr "" msgid "index out of range" msgstr "indice fuori intervallo" -#: py/obj.c -msgid "indices must be integers" -msgstr "gli indici devono essere interi" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3630,10 +3618,6 @@ msgstr "" msgid "no such attribute" msgstr "attributo inesistente" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3913,11 +3897,6 @@ msgstr "" msgid "relative import" msgstr "importazione relativa" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "lunghezza %d richiesta ma l'oggetto ha lunghezza %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3981,10 +3960,6 @@ msgstr "segno non permesso nello spcificatore di formato della stringa" msgid "sign not allowed with integer format specifier 'c'" msgstr "segno non permesso nello spcificatore di formato 'c' della stringa" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "'}' singolo presente nella stringa di formattazione" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4097,10 +4072,6 @@ msgstr "errore di sintassi nel JSON" msgid "syntax error in uctypes descriptor" msgstr "errore di sintassi nel descrittore uctypes" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "la soglia deve essere nell'intervallo 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4112,10 +4083,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4169,10 +4136,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "tupla/lista ha la lunghezza sbagliata" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4251,8 +4214,9 @@ msgid "unknown type '%q'" msgstr "tipo '%q' sconosciuto" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "'{' spaiato nella stringa di formattazione" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4322,10 +4286,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4415,6 +4375,28 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "gli indici %q devono essere interi, non %s" + +#~ msgid "indices must be integers" +#~ msgstr "gli indici devono essere interi" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "lunghezza %d richiesta ma l'oggetto ha lunghezza %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "'}' singolo presente nella stringa di formattazione" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "la soglia deve essere nell'intervallo 0-65536" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "tupla/lista ha la lunghezza sbagliata" + +#~ msgid "unmatched '{' in format" +#~ msgstr "'{' spaiato nella stringa di formattazione" + #~ msgid "To exit, please reset the board without " #~ msgstr "Per uscire resettare la scheda senza " diff --git a/locale/ja.po b/locale/ja.po index 3d3b5ef16c..f647d9acc7 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -115,10 +115,6 @@ msgstr "%qは使用中" msgid "%q index out of range" msgstr "%q インデックスは範囲外" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2355,10 +2351,6 @@ msgstr "WatchDogTimerは現在動作していません" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "WatchDogTimer.modeはいったんWatchDogMode.RESETに設定すると変更不可" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.timeoutは0以上でなければなりません" - #: py/builtinhelp.c #, c-format msgid "" @@ -3184,10 +3176,6 @@ msgstr "" msgid "index out of range" msgstr "インデクスが範囲外" -#: py/obj.c -msgid "indices must be integers" -msgstr "インデクスは整数でなければなりません" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3605,10 +3593,6 @@ msgstr "SDカードからの応答がありません" msgid "no such attribute" msgstr "指定の属性はありません" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3884,11 +3868,6 @@ msgstr "実数部と虚数部は同じ長さでなければなりません" msgid "relative import" msgstr "相対インポート" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "必要な長さは%dですがオブジェクトの長さは%d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3952,10 +3931,6 @@ msgstr "文字列フォーマット指定子で符号は使えません" msgid "sign not allowed with integer format specifier 'c'" msgstr "整数フォーマット指定子'c'で符号は使えません" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "文字列フォーマット中に孤立した '}' があります" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4068,10 +4043,6 @@ msgstr "JSONに構文エラーがあります" msgid "syntax error in uctypes descriptor" msgstr "uctypedディスクリプタの構文エラー" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "threshouldは0から65536まで" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time()は9要素のシーケンスを受け取ります" @@ -4083,10 +4054,6 @@ msgstr "time.struct_time()は9要素のシーケンスを受け取ります" msgid "timeout duration exceeded the maximum supported value" msgstr "タイムアウト長は対応する最大値を超えています" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "timeoutは0.0〜100.0秒でなければなりません" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4140,10 +4107,6 @@ msgstr "trapzは同じ長さの1次元arrayに対して定義されています" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "タプル/リストの長さが正しくありません" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4222,8 +4185,9 @@ msgid "unknown type '%q'" msgstr "不明な型 '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "書式中にマッチしない '{' があります" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4293,10 +4257,6 @@ msgstr "value_countは0より大きくなければなりません" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "watchdogのtimeoutは0以上でなければなりません" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4384,6 +4344,34 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.timeoutは0以上でなければなりません" + +#~ msgid "indices must be integers" +#~ msgstr "インデクスは整数でなければなりません" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "必要な長さは%dですがオブジェクトの長さは%d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "文字列フォーマット中に孤立した '}' があります" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "threshouldは0から65536まで" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "timeoutは0.0〜100.0秒でなければなりません" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "タプル/リストの長さが正しくありません" + +#~ msgid "unmatched '{' in format" +#~ msgstr "書式中にマッチしない '{' があります" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "watchdogのtimeoutは0以上でなければなりません" + #~ msgid "Stream missing readinto() or write() method." #~ msgstr "ストリームにreadinto()またはwrite()メソッドがありません" diff --git a/locale/ko.po b/locale/ko.po index 88c8b4d3c6..8ec7ede284 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -111,10 +111,6 @@ msgstr "%q 사용 중입니다" msgid "%q index out of range" msgstr "%q 인덱스 범위를 벗어났습니다" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2345,10 +2341,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3170,10 +3162,6 @@ msgstr "" msgid "index out of range" msgstr "" -#: py/obj.c -msgid "indices must be integers" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3590,10 +3578,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3867,11 +3851,6 @@ msgstr "" msgid "relative import" msgstr "" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3935,10 +3914,6 @@ msgstr "" msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4051,10 +4026,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4066,10 +4037,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4123,10 +4090,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4205,7 +4168,8 @@ msgid "unknown type '%q'" msgstr "" #: py/objstr.c -msgid "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" msgstr "" #: py/objtype.c py/runtime.c @@ -4276,10 +4240,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4367,6 +4327,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" + #~ msgid "%q must be >= 1" #~ msgstr "%q 는 >=1이어야합니다" diff --git a/locale/nl.po b/locale/nl.po index 69747fb971..990b6154df 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -113,10 +113,6 @@ msgstr "%q in gebruik" msgid "%q index out of range" msgstr "%q index buiten bereik" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q indexen moeten integers zijn, niet %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2371,10 +2367,6 @@ msgstr "" "WatchDogTimer.mode kan niet worden gewijzigd zodra de modus is ingesteld op " "WatchDogMode.RESET" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.timeout moet groter dan 0 zijn" - #: py/builtinhelp.c #, c-format msgid "" @@ -3200,10 +3192,6 @@ msgstr "index is buiten bereik" msgid "index out of range" msgstr "index is buiten bereik" -#: py/obj.c -msgid "indices must be integers" -msgstr "indices moeten integers zijn" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" @@ -3623,10 +3611,6 @@ msgstr "geen antwoord van SD kaart" msgid "no such attribute" msgstr "niet zo'n attribuut" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3900,11 +3884,6 @@ msgstr "reëel en imaginair deel moeten gelijke lengte hebben" msgid "relative import" msgstr "relatieve import" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "gevraagde lengte is %d maar object heeft lengte %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "resultaat kan niet naar gespecificeerd type geconverteerd worden" @@ -3968,10 +3947,6 @@ msgstr "teken niet toegestaan in string formaatspecificatie" msgid "sign not allowed with integer format specifier 'c'" msgstr "teken niet toegestaan bij integer formaatspecificatie 'c'" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "enkele '}' aangetroffen in formaat tekenreeks (string)" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "omvang is alleen voor ndarrays gedefinieerd" @@ -4084,10 +4059,6 @@ msgstr "syntaxisfout in JSON" msgid "syntax error in uctypes descriptor" msgstr "syntaxisfout in uctypes aanduiding" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "drempelwaarde moet in het bereik 0-65536 liggen" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() accepteert een 9-rij" @@ -4099,10 +4070,6 @@ msgstr "time.struct_time() accepteert een 9-rij" msgid "timeout duration exceeded the maximum supported value" msgstr "time-outduur is groter dan de ondersteunde maximale waarde" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4156,10 +4123,6 @@ msgstr "trapz is gedefinieerd voor eendimensionale arrays van gelijke lengte" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "tuple of lijst heeft onjuiste lengte" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4238,8 +4201,9 @@ msgid "unknown type '%q'" msgstr "onbekend type '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "'{' zonder overeenkomst in formaat" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4309,10 +4273,6 @@ msgstr "value_count moet groter dan 0 zijn" msgid "watchdog not initialized" msgstr "watchdog niet geïnitialiseerd" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "watchdog time-out moet groter zijn dan 0" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "breedte moet groter dan nul zijn" @@ -4400,6 +4360,37 @@ 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 "%q indices must be integers, not %s" +#~ msgstr "%q indexen moeten integers zijn, niet %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.timeout moet groter dan 0 zijn" + +#~ msgid "indices must be integers" +#~ msgstr "indices moeten integers zijn" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "gevraagde lengte is %d maar object heeft lengte %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "enkele '}' aangetroffen in formaat tekenreeks (string)" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "drempelwaarde moet in het bereik 0-65536 liggen" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "tuple of lijst heeft onjuiste lengte" + +#~ msgid "unmatched '{' in format" +#~ msgstr "'{' zonder overeenkomst in formaat" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "watchdog time-out moet groter zijn dan 0" + #~ msgid "To exit, please reset the board without " #~ msgstr "Om te beëindigen, reset het bord zonder " diff --git a/locale/pl.po b/locale/pl.po index 200a3eda99..0f0ae884ec 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -115,10 +115,6 @@ msgstr "%q w użyciu" msgid "%q index out of range" msgstr "%q poza zakresem" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q indeks musi być liczbą całkowitą, a nie %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2352,10 +2348,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.timeout musi być większe od 0" - #: py/builtinhelp.c #, c-format msgid "" @@ -3178,10 +3170,6 @@ msgstr "indeks jest poza zakresem" msgid "index out of range" msgstr "indeks poza zakresem" -#: py/obj.c -msgid "indices must be integers" -msgstr "indeksy muszą być całkowite" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3598,10 +3586,6 @@ msgstr "" msgid "no such attribute" msgstr "nie ma takiego atrybutu" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3876,11 +3860,6 @@ msgstr "rzeczywiste i urojone części muszą mieć jednakową długość" msgid "relative import" msgstr "relatywny import" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "zażądano długości %d ale obiekt ma długość %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3944,10 +3923,6 @@ msgstr "znak jest niedopuszczalny w specyfikacji formatu łańcucha" msgid "sign not allowed with integer format specifier 'c'" msgstr "znak jest niedopuszczalny w specyfikacji 'c'" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "pojedynczy '}' w specyfikacji formatu" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4060,10 +4035,6 @@ msgstr "błąd składni w JSON" msgid "syntax error in uctypes descriptor" msgstr "błąd składni w deskryptorze uctypes" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "threshold musi być w zakresie 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" @@ -4075,10 +4046,6 @@ msgstr "time.struct_time() wymaga 9-elementowej sekwencji" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4132,10 +4099,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "krotka/lista ma złą długość" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4214,8 +4177,9 @@ msgid "unknown type '%q'" msgstr "zły typ '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "niepasujące '{' for formacie" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4285,10 +4249,6 @@ msgstr "value_count musi być > 0" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "szerokość musi być większa niż zero" @@ -4376,6 +4336,31 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q indeks musi być liczbą całkowitą, a nie %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.timeout musi być większe od 0" + +#~ msgid "indices must be integers" +#~ msgstr "indeksy muszą być całkowite" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "zażądano długości %d ale obiekt ma długość %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "pojedynczy '}' w specyfikacji formatu" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "threshold musi być w zakresie 0-65536" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "krotka/lista ma złą długość" + +#~ msgid "unmatched '{' in format" +#~ msgstr "niepasujące '{' for formacie" + #~ msgid "To exit, please reset the board without " #~ msgstr "By wyjść, proszę zresetować płytkę bez " diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 23c301996b..4a6de92b4c 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -119,10 +119,6 @@ msgstr "%q em uso" msgid "%q index out of range" msgstr "O índice %q está fora do intervalo" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "Os índices %q devem ser inteiros, e não %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "a inicialização do %q falhou" @@ -2417,10 +2413,6 @@ msgstr "" "O WatchDogTimer.mode não pode ser alterado uma vez definido para " "WatchDogMode.RESET" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "O WatchDogTimer.timeout deve ser maior que 0" - #: py/builtinhelp.c #, c-format msgid "" @@ -3260,10 +3252,6 @@ msgstr "o índice está fora dos limites" msgid "index out of range" msgstr "Índice fora do intervalo" -#: py/obj.c -msgid "indices must be integers" -msgstr "os índices devem ser inteiros" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "os índices devem ser números inteiros, fatias ou listas booleanas" @@ -3686,10 +3674,6 @@ msgstr "não houve resposta do cartão SD" msgid "no such attribute" msgstr "não há tal atributo" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "não dispositivo em %q" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3968,11 +3952,6 @@ msgstr "partes reais e imaginárias devem ter o mesmo comprimento" msgid "relative import" msgstr "importação relativa" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "o comprimento solicitado %d, porém o objeto tem comprimento %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "os resultados não podem ser lançados para um determinado tipo" @@ -4036,10 +4015,6 @@ msgstr "sinal não permitido no especificador do formato da sequência" msgid "sign not allowed with integer format specifier 'c'" msgstr "sinal não permitido com o especificador no formato inteiro 'c'" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "único '}' encontrado na string do formato" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "o tamanho é definido apenas para os ndarrays" @@ -4152,10 +4127,6 @@ msgstr "erro de sintaxe no JSON" msgid "syntax error in uctypes descriptor" msgstr "houve um erro de sintaxe no descritor uctypes" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "Limite deve estar no alcance de 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() leva uma sequência com 9" @@ -4167,10 +4138,6 @@ msgstr "time.struct_time() leva uma sequência com 9" msgid "timeout duration exceeded the maximum supported value" msgstr "a duração do tempo limite excedeu o valor máximo suportado" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "o tempo limite deve ser entre 0.0 a 100.0 segundos" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "o tempo limite deve ser < 655.35 seg" @@ -4224,10 +4191,6 @@ msgstr "o trapz está definido para 1D arrays de igual tamanho" msgid "trapz is defined for 1D iterables" msgstr "o trapz é definido para iteráveis 1D" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "a tupla/lista está com tamanho incorreto" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4306,8 +4269,9 @@ msgid "unknown type '%q'" msgstr "tipo desconhecido '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "um '{' sem par no formato" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4377,10 +4341,6 @@ msgstr "o value_count deve ser > 0" msgid "watchdog not initialized" msgstr "o watchdog não foi inicializado" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "o tempo limite do watchdog deve ser maior que 0" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "a largura deve ser maior que zero" @@ -4468,6 +4428,40 @@ 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 "%q indices must be integers, not %s" +#~ msgstr "Os índices %q devem ser inteiros, e não %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "O WatchDogTimer.timeout deve ser maior que 0" + +#~ msgid "indices must be integers" +#~ msgstr "os índices devem ser inteiros" + +#~ msgid "non-Device in %q" +#~ msgstr "não dispositivo em %q" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "o comprimento solicitado %d, porém o objeto tem comprimento %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "único '}' encontrado na string do formato" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "Limite deve estar no alcance de 0-65536" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "o tempo limite deve ser entre 0.0 a 100.0 segundos" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "a tupla/lista está com tamanho incorreto" + +#~ msgid "unmatched '{' in format" +#~ msgstr "um '{' sem par no formato" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "o tempo limite do watchdog deve ser maior que 0" + #~ msgid "To exit, please reset the board without " #~ msgstr "Para sair, por favor, reinicie a placa sem " diff --git a/locale/ru.po b/locale/ru.po index cb9f3616ec..8516515291 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -118,10 +118,6 @@ msgstr "%q используется" msgid "%q index out of range" msgstr "Индекс %q вне диапазона" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "Индексы %q должны быть целыми числами, а не %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "" @@ -2390,10 +2386,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3215,10 +3207,6 @@ msgstr "" msgid "index out of range" msgstr "" -#: py/obj.c -msgid "indices must be integers" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3635,10 +3623,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3912,11 +3896,6 @@ msgstr "" msgid "relative import" msgstr "" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3980,10 +3959,6 @@ msgstr "" msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4096,10 +4071,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4111,10 +4082,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4168,10 +4135,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4250,7 +4213,8 @@ msgid "unknown type '%q'" msgstr "" #: py/objstr.c -msgid "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" msgstr "" #: py/objtype.c py/runtime.c @@ -4321,10 +4285,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4412,6 +4372,9 @@ msgstr "zi должно быть типа float" msgid "zi must be of shape (n_section, 2)" msgstr "zi должен иметь форму (n_section, 2)" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "Индексы %q должны быть целыми числами, а не %s" + #~ msgid "Firmware image is invalid" #~ msgstr "Образ прошивки неправильный" diff --git a/locale/sv.po b/locale/sv.po index 598843479c..d7dbb949b2 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -118,10 +118,6 @@ msgstr "%q används redan" msgid "%q index out of range" msgstr "Index %q ligger utanför intervallet" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "Indexet %q måste vara ett heltal, inte %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "%q init misslyckades" @@ -2389,10 +2385,6 @@ msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" "WatchDogTimer.mode kan inte ändras när den är inställd på WatchDogMode.RESET" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.timeout måste vara större än 0" - #: py/builtinhelp.c #, c-format msgid "" @@ -3228,10 +3220,6 @@ msgstr "index är utanför gränserna" msgid "index out of range" msgstr "index utanför intervallet" -#: py/obj.c -msgid "indices must be integers" -msgstr "index måste vara heltal" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "index måste vara heltal, slices, eller Boolean-listor" @@ -3651,10 +3639,6 @@ msgstr "inget svar från SD-kort" msgid "no such attribute" msgstr "inget sådant attribut" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "icke-enhet i %q" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3929,11 +3913,6 @@ msgstr "verkliga och imaginära delar måste ha samma längd" msgid "relative import" msgstr "relativ import" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "begärd längd %d men objektet har längden %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "resultaten kan inte castas till angiven typ" @@ -3997,10 +3976,6 @@ msgstr "tecknet tillåts inte i strängformatspecificerare" msgid "sign not allowed with integer format specifier 'c'" msgstr "tecken tillåts inte med heltalsformatspecificeraren 'c'" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "Enkelt '}' påträffades i formatsträngen" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "storlek är enbart definierad ndarrays" @@ -4113,10 +4088,6 @@ msgstr "syntaxfel i JSON" msgid "syntax error in uctypes descriptor" msgstr "syntaxfel i uctypes deskriptor" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "tröskelvärdet måste ligga i intervallet 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" @@ -4128,10 +4099,6 @@ msgstr "time.struct_time() kräver en 9-sekvens" msgid "timeout duration exceeded the maximum supported value" msgstr "timeout-längd överskred det maximala värde som stöds" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "timeout måste vara 0.0-100.0 sekunder" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "timeout måste vara < 655,35 sekunder" @@ -4185,10 +4152,6 @@ msgstr "trapz är definierad för 1D-matriser med samma längd" msgid "trapz is defined for 1D iterables" msgstr "trapz är definierat för 1D-iterabla" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "tupel/lista har fel längd" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4267,8 +4230,9 @@ msgid "unknown type '%q'" msgstr "okänd typ '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "omatchad '{' i format" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4338,10 +4302,6 @@ msgstr "value_count måste vara > 0" msgid "watchdog not initialized" msgstr "watchdog är inte initierad" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "watchdog timeout måste vara större än 0" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "width måste vara större än noll" @@ -4429,6 +4389,40 @@ 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 "%q indices must be integers, not %s" +#~ msgstr "Indexet %q måste vara ett heltal, inte %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.timeout måste vara större än 0" + +#~ msgid "indices must be integers" +#~ msgstr "index måste vara heltal" + +#~ msgid "non-Device in %q" +#~ msgstr "icke-enhet i %q" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "begärd längd %d men objektet har längden %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "Enkelt '}' påträffades i formatsträngen" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "tröskelvärdet måste ligga i intervallet 0-65536" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "timeout måste vara 0.0-100.0 sekunder" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "tupel/lista har fel längd" + +#~ msgid "unmatched '{' in format" +#~ msgstr "omatchad '{' i format" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "watchdog timeout måste vara större än 0" + #~ msgid "To exit, please reset the board without " #~ msgstr "För att avsluta, gör reset på kortet utan " diff --git a/locale/tr.po b/locale/tr.po index ae8844521d..9734232c62 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -122,10 +122,6 @@ msgstr "%q kullanımda" msgid "%q index out of range" msgstr "%q indeksi aralık dışında" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q indeksleri integer olmalı, %s değil" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "%q init başarısız oldu" @@ -2361,10 +2357,6 @@ msgstr "" msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -3186,10 +3178,6 @@ msgstr "" msgid "index out of range" msgstr "" -#: py/obj.c -msgid "indices must be integers" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" @@ -3606,10 +3594,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3883,11 +3867,6 @@ msgstr "" msgid "relative import" msgstr "" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "" @@ -3951,10 +3930,6 @@ msgstr "" msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "" @@ -4067,10 +4042,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4082,10 +4053,6 @@ msgstr "" msgid "timeout duration exceeded the maximum supported value" msgstr "" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "" @@ -4139,10 +4106,6 @@ msgstr "" msgid "trapz is defined for 1D iterables" msgstr "" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4221,7 +4184,8 @@ msgid "unknown type '%q'" msgstr "" #: py/objstr.c -msgid "unmatched '{' in format" +#, c-format +msgid "unmatched '%c' in format" msgstr "" #: py/objtype.c py/runtime.c @@ -4292,10 +4256,6 @@ msgstr "" msgid "watchdog not initialized" msgstr "" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "" @@ -4383,6 +4343,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q indeksleri integer olmalı, %s değil" + #~ msgid "%q must be >= 0" #~ msgstr "%q >= 0 olmalıdır" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 6cf446c792..e1313e5b06 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -121,10 +121,6 @@ msgstr "%q zhèngzài bèi shǐyòng" msgid "%q index out of range" msgstr "%q suǒyǐn chāochū fànwéi" -#: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" - #: shared-module/bitbangio/SPI.c msgid "%q init failed" msgstr "%q chūshǐhuà shībài" @@ -2392,10 +2388,6 @@ msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" "Yīdàn shèzhì wèi WatchDogMode.RESET, zé bùnéng gēnggǎi WatchDogTimer.Mode" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "WatchDogTimer.Timeout bìxū dàyú 0" - #: py/builtinhelp.c #, c-format msgid "" @@ -3230,10 +3222,6 @@ msgstr "suǒyǐn chāochū fànwéi" msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" -#: py/obj.c -msgid "indices must be integers" -msgstr "suǒyǐn bìxū shì zhěngshù" - #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "suǒyǐn bìxū shì zhěngshù, qiēpiàn huò bù'ěr zhí lièbiǎo" @@ -3651,10 +3639,6 @@ msgstr "SD kǎ wú huíyīng" msgid "no such attribute" msgstr "méiyǒu cǐ shǔxìng" -#: shared-bindings/usb_hid/__init__.c -msgid "non-Device in %q" -msgstr "fēi shè bèi zài %q" - #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3928,11 +3912,6 @@ msgstr "shí bù hé xū bù bìxū děng zhǎng" msgid "relative import" msgstr "xiāngduì dǎorù" -#: py/obj.c -#, c-format -msgid "requested length %d but object has length %d" -msgstr "qǐngqiú chángdù %d dàn duìxiàng chángdù %d" - #: extmod/ulab/code/ndarray_operators.c msgid "results cannot be cast to specified type" msgstr "wú fǎ jiāng jié guǒ qiáng zhì zhuǎn huàn dào zhǐ dìng lèi xíng" @@ -3996,10 +3975,6 @@ msgstr "zìfú chuàn géshì shuōmíng fú zhōng bù yǔnxǔ shǐyòng fúhà msgid "sign not allowed with integer format specifier 'c'" msgstr "zhěngshù géshì shuōmíng fú 'c' bù yǔnxǔ shǐyòng fúhào" -#: py/objstr.c -msgid "single '}' encountered in format string" -msgstr "zài géshì zìfú chuàn zhōng yù dào de dāngè '}'" - #: extmod/ulab/code/ulab_tools.c msgid "size is defined for ndarrays only" msgstr "dàxiǎo jǐn wèi ndarrays dìngyì" @@ -4115,10 +4090,6 @@ msgstr "JSON yǔfǎ cuòwù" msgid "syntax error in uctypes descriptor" msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù" -#: shared-bindings/touchio/TouchIn.c -msgid "threshold must be in the range 0-65536" -msgstr "yùzhí bìxū zài fànwéi 0-65536" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" @@ -4130,10 +4101,6 @@ msgstr "time.struct_time() xūyào 9 xùliè" msgid "timeout duration exceeded the maximum supported value" msgstr "chāoshí shíjiān chāoguò zuìdà zhīchí zhí" -#: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 seconds" -msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "timeout must be < 655.35 secs" msgstr "chāo shí bì xū < 655.35 miǎo" @@ -4187,10 +4154,6 @@ msgstr "Trapz shì wèi děng zhǎng de 1D shùzǔ dìngyì de" msgid "trapz is defined for 1D iterables" msgstr "tī xíng dìng yì wéi yì wéi kě dié dài duì xiàng" -#: py/obj.c -msgid "tuple/list has wrong length" -msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" - #: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" @@ -4269,8 +4232,9 @@ msgid "unknown type '%q'" msgstr "wèizhī lèixíng '%q'" #: py/objstr.c -msgid "unmatched '{' in format" -msgstr "géshì wèi pǐpèi '{'" +#, c-format +msgid "unmatched '%c' in format" +msgstr "" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4340,10 +4304,6 @@ msgstr "zhí jìshù bìxū wèi > 0" msgid "watchdog not initialized" msgstr "wèi chū shǐ huà jiān shì qì" -#: shared-bindings/watchdog/WatchDogTimer.c -msgid "watchdog timeout must be greater than 0" -msgstr "kān mén gǒu chāoshí bìxū dàyú 0" - #: shared-bindings/is31fl3741/FrameBuffer.c msgid "width must be greater than zero" msgstr "kuāndù bìxū dàyú líng" @@ -4431,6 +4391,40 @@ 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 "%q indices must be integers, not %s" +#~ msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" + +#~ msgid "WatchDogTimer.timeout must be greater than 0" +#~ msgstr "WatchDogTimer.Timeout bìxū dàyú 0" + +#~ msgid "indices must be integers" +#~ msgstr "suǒyǐn bìxū shì zhěngshù" + +#~ msgid "non-Device in %q" +#~ msgstr "fēi shè bèi zài %q" + +#, c-format +#~ msgid "requested length %d but object has length %d" +#~ msgstr "qǐngqiú chángdù %d dàn duìxiàng chángdù %d" + +#~ msgid "single '}' encountered in format string" +#~ msgstr "zài géshì zìfú chuàn zhōng yù dào de dāngè '}'" + +#~ msgid "threshold must be in the range 0-65536" +#~ msgstr "yùzhí bìxū zài fànwéi 0-65536" + +#~ msgid "timeout must be 0.0-100.0 seconds" +#~ msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" + +#~ msgid "tuple/list has wrong length" +#~ msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" + +#~ msgid "unmatched '{' in format" +#~ msgstr "géshì wèi pǐpèi '{'" + +#~ msgid "watchdog timeout must be greater than 0" +#~ msgstr "kān mén gǒu chāoshí bìxū dàyú 0" + #~ msgid "To exit, please reset the board without " #~ msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " From 09f6919c93e6c182f138f5bdc5b6dc3a433380f3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 09:36:50 -0600 Subject: [PATCH 055/357] Add ability to read VOLTAGE_MONITOR on Pico W Because this must be treated like an in-use pin for all other purposes, unfortunately a special case must be added in shared-bindings. Multiple AnalogIn objects for VOLTAGE_MONITOR can be created (because in use tracking isn't working) but this causes no harm. Testing performed: Read the monitor, then imported wifi. When the pin state was insufficiently restored, the second step would fail with debug messages about do_ioctl timeout. ``` import analogio, board a = analogio.AnalogIn(board.VOLTAGE_MONITOR) print(a.value) import wifi ``` Closes: #7020 --- ports/raspberrypi/bindings/cyw43/__init__.c | 8 ++++ ports/raspberrypi/bindings/cyw43/__init__.h | 1 + .../boards/raspberry_pi_pico_w/pins.c | 4 ++ .../common-hal/analogio/AnalogIn.c | 39 +++++++++++++++---- shared-bindings/analogio/AnalogIn.c | 9 ++++- 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/ports/raspberrypi/bindings/cyw43/__init__.c b/ports/raspberrypi/bindings/cyw43/__init__.c index bf0cbc2e67..c72581a6e4 100644 --- a/ports/raspberrypi/bindings/cyw43/__init__.c +++ b/ports/raspberrypi/bindings/cyw43/__init__.c @@ -123,6 +123,14 @@ const mcu_pin_obj_t *validate_obj_is_pin_including_cyw43(mp_obj_t obj) { return MP_OBJ_TO_PTR(obj); } +const mcu_pin_obj_t *validate_obj_is_free_pin_or_gpio29(mp_obj_t obj) { + const mcu_pin_obj_t *pin = validate_obj_is_pin(obj); + if (obj != &pin_GPIO29) { + assert_pin_free(pin); + } + return pin; +} + const mcu_pin_obj_t *validate_obj_is_free_pin_including_cyw43(mp_obj_t obj) { const mcu_pin_obj_t *pin = validate_obj_is_pin_including_cyw43(obj); assert_pin_free(pin); diff --git a/ports/raspberrypi/bindings/cyw43/__init__.h b/ports/raspberrypi/bindings/cyw43/__init__.h index 2520c6c2d1..65e9813f99 100644 --- a/ports/raspberrypi/bindings/cyw43/__init__.h +++ b/ports/raspberrypi/bindings/cyw43/__init__.h @@ -32,6 +32,7 @@ extern const mp_obj_type_t cyw43_pin_type; const mcu_pin_obj_t *validate_obj_is_free_pin_including_cyw43(mp_obj_t obj); +const mcu_pin_obj_t *validate_obj_is_free_pin_or_gpio29(mp_obj_t obj); const mcu_pin_obj_t *validate_obj_is_pin_including_cyw43(mp_obj_t obj); #define CONSTANT_CYW43_PM_VALUE(pm_mode, pm2_sleep_ret_ms, li_beacon_period, li_dtim_period, li_assoc) \ diff --git a/ports/raspberrypi/boards/raspberry_pi_pico_w/pins.c b/ports/raspberrypi/boards/raspberry_pi_pico_w/pins.c index 5a63e43a6d..8c85642597 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico_w/pins.c +++ b/ports/raspberrypi/boards/raspberry_pi_pico_w/pins.c @@ -45,6 +45,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + + { 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/raspberrypi/common-hal/analogio/AnalogIn.c b/ports/raspberrypi/common-hal/analogio/AnalogIn.c index b827068e1a..1dc4749208 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogIn.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogIn.c @@ -35,16 +35,26 @@ #define ADC_FIRST_PIN_NUMBER 26 #define ADC_PIN_COUNT 4 +// Voltage monitor is special on Pico W, because this pin is shared between the +// voltage monitor function and the wifi function. Special handling is required +// to read the analog voltage. +#if CIRCUITPY_CYW43 +#define SPECIAL_PIN(pin) (pin->number == 29) +#else +#define SPECIAL_PIN(pin) false +#endif + void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->number < ADC_FIRST_PIN_NUMBER || pin->number > ADC_FIRST_PIN_NUMBER + ADC_PIN_COUNT) { raise_ValueError_invalid_pin(); } adc_init(); + if (!SPECIAL_PIN(pin)) { + adc_gpio_init(pin->number); + claim_pin(pin); + } - adc_gpio_init(pin->number); - - claim_pin(pin); self->pin = pin; } @@ -57,14 +67,29 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { return; } - reset_pin_number(self->pin->number); + if (!SPECIAL_PIN(self->pin)) { + reset_pin_number(self->pin->number); + } self->pin = NULL; } uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { - adc_select_input(self->pin->number - ADC_FIRST_PIN_NUMBER); - uint16_t value = adc_read(); - + uint16_t value; + if (SPECIAL_PIN(self->pin)) { + common_hal_mcu_disable_interrupts(); + uint32_t old_pad = padsbank0_hw->io[self->pin->number]; + uint32_t old_ctrl = iobank0_hw->io[self->pin->number].ctrl; + adc_gpio_init(self->pin->number); + adc_select_input(self->pin->number - ADC_FIRST_PIN_NUMBER); + value = adc_read(); + gpio_init(self->pin->number); + padsbank0_hw->io[self->pin->number] = old_pad; + iobank0_hw->io[self->pin->number].ctrl = old_ctrl; + common_hal_mcu_enable_interrupts(); + } else { + adc_select_input(self->pin->number - ADC_FIRST_PIN_NUMBER); + value = adc_read(); + } // Stretch 12-bit ADC reading to 16-bit range return (value << 4) | (value >> 8); } diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 0ca0e09023..274bfa4806 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -36,6 +36,10 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/util.h" +#if CIRCUITPY_CYW43 +#include "bindings/cyw43/__init__.h" +#endif + //| class AnalogIn: //| """Read analog voltage levels //| @@ -60,8 +64,11 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, mp_arg_check_num(n_args, n_kw, 1, 1, false); // 1st argument is the pin + #if CIRCUITPY_CYW43 + const mcu_pin_obj_t *pin = validate_obj_is_free_pin_or_gpio29(args[0]); + #else const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[0]); - + #endif analogio_analogin_obj_t *self = m_new_obj(analogio_analogin_obj_t); self->base.type = &analogio_analogin_type; common_hal_analogio_analogin_construct(self, pin); From 7f36a365cf855906f4a5e00305f18a4949039f02 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 10:42:14 -0600 Subject: [PATCH 056/357] delay 100us for analog voltage to stabilize .. otherwise, depending on the prior state of the pin as a digital input, the value read could be 20% low. --- ports/raspberrypi/common-hal/analogio/AnalogIn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/common-hal/analogio/AnalogIn.c b/ports/raspberrypi/common-hal/analogio/AnalogIn.c index 1dc4749208..0056eb17b5 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogIn.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogIn.c @@ -26,6 +26,7 @@ #include "common-hal/analogio/AnalogIn.h" #include "shared-bindings/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" #include "supervisor/shared/translate/translate.h" @@ -81,6 +82,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { uint32_t old_ctrl = iobank0_hw->io[self->pin->number].ctrl; adc_gpio_init(self->pin->number); adc_select_input(self->pin->number - ADC_FIRST_PIN_NUMBER); + common_hal_mcu_delay_us(100); value = adc_read(); gpio_init(self->pin->number); padsbank0_hw->io[self->pin->number] = old_pad; From 843d6b42f9e2794a1cde117e99f06cccc932c3fe Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Tue, 8 Nov 2022 12:04:30 -0800 Subject: [PATCH 057/357] formatting(swan_r5): lexicographically sorted the board module names in the swan_r5 makefile include [ci-skip][skip-ci]. Skip CI since this is a cosmetic change only. --- ports/stm/boards/swan_r5/mpconfigboard.mk | 91 +++++++++-------------- 1 file changed, 35 insertions(+), 56 deletions(-) diff --git a/ports/stm/boards/swan_r5/mpconfigboard.mk b/ports/stm/boards/swan_r5/mpconfigboard.mk index 9e5be99bfa..ea4125e02b 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.mk +++ b/ports/stm/boards/swan_r5/mpconfigboard.mk @@ -15,63 +15,42 @@ LD_DEFAULT = boards/STM32L4R5_default.ld LD_BOOT = boards/STM32L4R5_boot.ld UF2_OFFSET = 0x8010000 UF2_BOOTLOADER ?= 1 - -# Turn all of the below off while trying to get the thing to run -# These modules are implemented in ports//common-hal: - -# Typically the first module to create -CIRCUITPY_MICROCONTROLLER = 1 -CIRCUITPY_ALARM = 1 - -# Typically the second module to create -CIRCUITPY_DIGITALIO = 1 -# Other modules: - -CIRCUITPY_OS = 1 -CIRCUITPY_STORAGE = 1 -CIRCUITPY_USB_MSC = 1 -CIRCUITPY_UDB_CDC = 1 -CIRCUITPY_USB_VENDOR = 1 -CIRCUITPY_NVM = 0 - -CIRCUITPY_ANALOGIO = 1 -CIRCUITPY_BUSIO = 1 -CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_PULSEIO = 1 -CIRCUITPY_PWMIO = 1 -CIRCUITPY_AUDIOPWMIO = 1 -CIRCUITPY_CANIO = 0 -CIRCUITPY_I2CTARGET = 0 -# Requires SPI, PulseIO (stub ok): -CIRCUITPY_DISPLAYIO = 1 - -# These modules are implemented in shared-module/ - they can be included in -# any port once their prerequisites in common-hal are complete. -# Requires DigitalIO: -CIRCUITPY_BITBANGIO = 1 -# Requires neopixel_write or SPI (dotstar) -CIRCUITPY_PIXELBUF = 0 -# Requires OS -CIRCUITPY_RANDOM = 1 -# Requires Microcontroller -CIRCUITPY_TOUCHIO = 1 -# Requires USB -CIRCUITPY_USB_HID = 0 -CIRCUITPY_USB_MIDI = 0 -# Does nothing without I2C -CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 -# No requirements, but takes extra flash -CIRCUITPY_ULAB = 1 -# requires SPI -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_BLEIO_HCI = 0 -CIRCUITPY_BLEIO = 0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_KEYPAD = 1 -CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_RTC = 1 CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 -CIRCUITPY_ENABLE_MPY_NATIVE = 1 + +CIRCUITPY_ALARM = 1 +CIRCUITPY_ANALOGIO = 1 CIRCUITPY_AUDIOBUSIO = 1 CIRCUITPY_AUDIOBUSIO_I2SOUT = 0 CIRCUITPY_AUDIOBUSIO_PDMIN = 1 +CIRCUITPY_AUDIOPWMIO = 1 +CIRCUITPY_BITBANGIO = 1 +CIRCUITPY_BLEIO = 0 +CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_BUSDEVICE = 0 +CIRCUITPY_BUSIO = 1 +CIRCUITPY_CANIO = 0 +CIRCUITPY_DIGITALIO = 1 +CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_ENABLE_MPY_NATIVE = 1 +CIRCUITPY_I2CTARGET = 0 +CIRCUITPY_KEYPAD = 1 +CIRCUITPY_MICROCONTROLLER = 1 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_OS = 1 +CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_PULSEIO = 1 +CIRCUITPY_PWMIO = 1 +CIRCUITPY_RANDOM = 1 +CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_RTC = 1 +CIRCUITPY_SDCARDIO = 0 +CIRCUITPY_STORAGE = 1 +CIRCUITPY_TOUCHIO = 1 +CIRCUITPY_UDB_CDC = 1 +CIRCUITPY_ULAB = 1 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 +CIRCUITPY_USB_MSC = 1 +CIRCUITPY_USB_VENDOR = 1 From 97f693d2d8b782bb805fad29e26acc31616ca490 Mon Sep 17 00:00:00 2001 From: Matthew McGowan Date: Tue, 8 Nov 2022 14:18:54 -0800 Subject: [PATCH 058/357] docs(swan_r5): updated copyright notices --- ports/stm/common-hal/audiobusio/MEMS_Audio.c | 24 ++++++++++++++++++ ports/stm/common-hal/audiobusio/MEMS_Audio.h | 24 ++++++++++++++++++ .../stm/common-hal/audiobusio/MEMS_Audio_ll.h | 25 +++++++++++++++++++ .../audiobusio/MEMS_Audio_ll_stm32l4.c | 25 +++++++++++++++++++ .../audiobusio/MEMS_Audio_ll_stm32l4.h | 25 +++++++++++++++++++ ports/stm/common-hal/audiobusio/PDMIn.c | 2 +- ports/stm/common-hal/audiobusio/PDMIn.h | 2 +- 7 files changed, 125 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio.c b/ports/stm/common-hal/audiobusio/MEMS_Audio.c index 4371b609c0..624ffc92b0 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio.c +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio.c @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2022 Matthew McGowan for Blues Inc. + * + * 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 #include diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio.h b/ports/stm/common-hal/audiobusio/MEMS_Audio.h index a26b94fef3..2f670c8505 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio.h +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio.h @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2022 Matthew McGowan for Blues Inc. + * + * 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. + */ + #ifndef _MEMS_AUDIO_H_ #define _MEMS_AUDIO_H_ diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll.h b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll.h index 6419b90959..13d218fd5d 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll.h +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll.h @@ -1,3 +1,28 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2022 Matthew McGowan for Blues Inc. + * + * 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. + */ + + #ifndef _MEMS_AUDIO_LL_H_ #define _MEMS_AUDIO_LL_H_ diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c index 71f046f9b9..d10cdcd23e 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.c @@ -1,3 +1,28 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2022 Matthew McGowan for Blues Inc. + * + * 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 #include "MEMS_Audio_ll_stm32l4.h" #include "MEMS_Audio.h" diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h index c76ccce5e1..ce2c397d47 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h @@ -1,3 +1,28 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2022 Matthew McGowan for Blues Inc. + * + * 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. + */ + + #ifndef _MEMS_AUDIO_LL_STM32L4_H_ #define _MEMS_AUDIO_LL_STM32L4_H_ diff --git a/ports/stm/common-hal/audiobusio/PDMIn.c b/ports/stm/common-hal/audiobusio/PDMIn.c index b1aa2047d8..5deb785371 100644 --- a/ports/stm/common-hal/audiobusio/PDMIn.c +++ b/ports/stm/common-hal/audiobusio/PDMIn.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2019 Jeff Epler for Adafruit Industries + * Copyright (c) 2022 Matthew McGowan for Blues Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/stm/common-hal/audiobusio/PDMIn.h b/ports/stm/common-hal/audiobusio/PDMIn.h index b6ef4ee8bf..64c0d2b167 100644 --- a/ports/stm/common-hal/audiobusio/PDMIn.h +++ b/ports/stm/common-hal/audiobusio/PDMIn.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2019 Jeff Epler for Adafruit Industries + * Copyright (c) 2022 Matthew McGowan for Blues Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From 11ce0743187197fc5abc3e8f4fec6524c14208dd Mon Sep 17 00:00:00 2001 From: dronecz Date: Tue, 8 Nov 2022 23:43:13 +0100 Subject: [PATCH 059/357] Update mpconfigboard.mk --- ports/espressif/boards/maker_badge/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/maker_badge/mpconfigboard.mk b/ports/espressif/boards/maker_badge/mpconfigboard.mk index bb96550da0..75d713d904 100644 --- a/ports/espressif/boards/maker_badge/mpconfigboard.mk +++ b/ports/espressif/boards/maker_badge/mpconfigboard.mk @@ -9,7 +9,7 @@ CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=4MB -CIRCUITPY_MODULE=wroom +IDF_TARGET = esp32s2 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel From 93b6772c65c7f0b4b6b6cc8535bcf6d6aa4d2300 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 8 Nov 2022 01:25:20 +0000 Subject: [PATCH 060/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (993 of 993 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 4a6de92b4c..828e305c38 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-11-02 09:33+0000\n" +"PO-Revision-Date: 2022-11-09 10:48+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.14.2-dev\n" +"X-Generator: Weblate 4.15-dev\n" #: main.c msgid "" @@ -4271,7 +4271,7 @@ msgstr "tipo desconhecido '%q'" #: py/objstr.c #, c-format msgid "unmatched '%c' in format" -msgstr "" +msgstr "'%c' sem correspondência no formato" #: py/objtype.c py/runtime.c msgid "unreadable attribute" From 7a26443da8beecab71820d12cb066738e656aa4a Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 8 Nov 2022 08:25:00 +0000 Subject: [PATCH 061/357] Translated using Weblate (Swedish) Currently translated at 100.0% (993 of 993 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index d7dbb949b2..4c9bd6e193 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-10-31 13:02+0000\n" +"PO-Revision-Date: 2022-11-09 10:48+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.14.2-dev\n" +"X-Generator: Weblate 4.15-dev\n" #: main.c msgid "" @@ -4232,7 +4232,7 @@ msgstr "okänd typ '%q'" #: py/objstr.c #, c-format msgid "unmatched '%c' in format" -msgstr "" +msgstr "Omatchad '%c' i format" #: py/objtype.c py/runtime.c msgid "unreadable attribute" From e390e7142638f582a18233f3080ac7f4e4118b5b Mon Sep 17 00:00:00 2001 From: Ettore Atalan Date: Wed, 9 Nov 2022 18:29:11 +0000 Subject: [PATCH 062/357] Translated using Weblate (German) Currently translated at 99.7% (991 of 993 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 70 ++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 17676cfa51..99bc2e96df 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,14 +6,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-11-04 15:05+0000\n" +"PO-Revision-Date: 2022-11-09 19:20+0000\n" "Last-Translator: Ettore Atalan \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "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.14.2-dev\n" +"X-Generator: Weblate 4.15-dev\n" #: main.c msgid "" @@ -38,7 +38,7 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" "\n" -"Bitte melden Sie ein Problem mit dem Inhalt Ihres CIRCUITPY-Laufwerks unter\n" +"Bitte melde ein Problem mit dem Inhalt Ihres CIRCUITPY-Laufwerks unter\n" "https://github.com/adafruit/circuitpython/issues\n" #: py/obj.c @@ -555,8 +555,8 @@ msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" -"Automatisches Neuladen ist aktiv. Speichere Dateien über USB um sie " -"auszuführen oder verbinde dich mit der REPL zum Deaktivieren.\n" +"Automatisches Neuladen ist aktiviert. Speichere Dateien einfach über USB, um " +"sie auszuführen, oder gib REPL ein, um sie zu deaktivieren.\n" #: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" @@ -820,8 +820,8 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" -"Die Verbindung wurde getrennt und kann nicht mehr verwendet werden. " -"Erstellen Sie eine neue Verbindung." +"Die Verbindung wurde getrennt und kann nicht mehr verwendet werden. Erstelle " +"eine neue Verbindung." #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -857,7 +857,7 @@ msgstr "DAC-Kanal-Initialisierungsfehler" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "DAC Device Initialisierungs-Fehler" +msgstr "DAC-Gerät-Initialisierungsfehler" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -1082,7 +1082,7 @@ msgstr "Die Funktion erwartet, dass der 'lock'-Befehl zuvor ausgeführt wurde" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "GNSS init" -msgstr "GNSS Initialisierung" +msgstr "GNSS-Initialisierung" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" @@ -1105,7 +1105,7 @@ msgstr "Hald-Duplex SPI is tnicht implementiert" #: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c #: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" -msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" +msgstr "Hardware beschäftigt, versuche alternative Pins" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" @@ -1117,7 +1117,7 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" #: ports/stm/common-hal/busio/I2C.c msgid "I2C init error" -msgstr "I2C Initialisierungsfehler" +msgstr "I2C-Initialisierungsfehler" #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c @@ -1142,7 +1142,7 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"Inkompatible mpy-Datei. Bitte aktualisieren Sie alle mpy-Dateien. Siehe " +"Inkompatible .mpy-Datei. Bitte aktualisiere alle .mpy-Dateien. Siehe " "http://adafru.it/mpy-update für weitere Informationen." #: shared-bindings/_pew/PewPew.c @@ -1779,8 +1779,8 @@ msgid "" "constructor" msgstr "" "Pinbelegung verwendet %d Bytes pro Element, was mehr als die idealen %d " -"Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergeben Sie " -"allow_inefficient = True an den Konstruktor" +"Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergib " +"allow_inefficient=True an den Konstruktor" #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" @@ -1919,7 +1919,7 @@ msgstr "SD-Card CSD-Format nicht unterstützt" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "SDCard init" -msgstr "SDCard Initialisierung" +msgstr "SDCard-Initialisierung" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format @@ -1937,7 +1937,7 @@ msgstr "SPI-Konfiguration fehlgeschlagen" #: ports/stm/common-hal/busio/SPI.c msgid "SPI init error" -msgstr "SPI Initialisierungsfehler" +msgstr "SPI-Initialisierungsfehler" #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" @@ -1954,7 +1954,7 @@ msgstr "Maßstabs-Abmeßungen müssen durch 3 teilbar sein" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scannen Sie bereits in Bearbeitung. Stoppen Sie mit stop_scan." +msgstr "Scannen bereits in Bearbeitung. Stoppe mit stop_scan." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1996,7 +1996,7 @@ msgstr "Quell- und Zielbuffer müssen gleich lang sein" #: shared-bindings/paralleldisplay/ParallelBus.c msgid "Specify exactly one of data0 or data_pins" -msgstr "Geben Sie genau einen von data0 oder data_pins an" +msgstr "Gib genau einen von data0 oder data_pins an" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -2012,11 +2012,11 @@ msgstr "Stereo rechts muss sich auf PWM-Kanal B befinden" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "Geben Sie mindestens einen UART-Pin an" +msgstr "Gib mindestens einen UART-Pin an" #: shared-bindings/alarm/time/TimeAlarm.c msgid "Supply one of monotonic_time or epoch_time" -msgstr "Geben Sie entweder monotonic_time oder epoch_time an" +msgstr "Gib entweder monotonic_time oder epoch_time an" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" @@ -2036,7 +2036,7 @@ msgid "" "Increase the stack size if you know how. If not:" msgstr "" "Der Heap von CircuitPython wurde beschädigt, weil der Stack zu klein war.\n" -"Vergrößern Sie den Stack, wenn Sie wissen, wie. Wenn nicht:" +"Vergrößere den Stack, wenn du weißt, wie. Wenn nicht:" #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "The SW38 button was pressed at start up.\n" @@ -2052,7 +2052,7 @@ msgid "" "exit safe mode." msgstr "" "Das Modul `microcontroller` wurde zum Booten in den abgesicherten Modus " -"verwendet. Drücken Sie Reset, um den abgesicherten Modus zu verlassen." +"verwendet. Drücke Reset, um den abgesicherten Modus zu verlassen." #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" @@ -2072,10 +2072,9 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY)." msgstr "" -"Der Mikrocontroller hatte einen Stromausfall. Vergewissern Sie sich, dass " -"die\n" -"Stromversorgung genügend Strom für die gesamte Schaltung liefert und drücken " -"Sie Reset (nach dem Auswerfen von CIRCUITPY)." +"Der Mikrocontroller hatte einen Stromausfall. Vergewisser dich, dass die\n" +"Stromversorgung genügend Strom für die gesamte Schaltung liefert und\n" +"drücke Reset (nach dem Auswerfen von CIRCUITPY)." #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -2133,6 +2132,8 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without requesting safe mode." msgstr "" +"Zum Beenden setze bitte das Board zurück, ohne den abgesicherten Modus " +"aufzurufen." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2176,11 +2177,11 @@ msgstr "UART wird de-initialisiert" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "UART init" -msgstr "UART Initialisierung" +msgstr "UART-Initialisierung" #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" -msgstr "UART wird wieder Initialisiert" +msgstr "UART wird erneut Initialisiert" #: ports/stm/common-hal/busio/UART.c msgid "UART write" @@ -2432,7 +2433,7 @@ msgstr "Schreiben nicht unterstüzt für diese Charakteristik" #: supervisor/shared/safe_mode.c msgid "You are in safe mode because:\n" -msgstr "Du bist im abgesicherten Modus weil:\n" +msgstr "Du befindest dich im abgesicherten Modus, weil:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2521,7 +2522,7 @@ msgstr "Versuch (arg)min/(arg)max einer leeren Sequenz zu holen" #: extmod/ulab/code/numpy/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "Sie haben versucht argmin/argmax einer leeren Sequenz zu erhalten" +msgstr "Versuch, argmin/argmax einer leeren Sequenz zu ermitteln" #: py/objstr.c msgid "attributes not supported yet" @@ -3449,8 +3450,8 @@ msgstr "" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" msgstr "" -"Schlüsselwort-Argument(e) noch nicht implementiert - verwenden Sie " -"stattdessen normale Argumente" +"Schlüsselwort-Argument(e) noch nicht implementiert - verwende stattdessen " +"normale Argumente" #: py/bc.c msgid "keywords must be strings" @@ -4091,8 +4092,7 @@ msgstr "String Indizes müssen Integer sein, nicht %q" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" -"Zeichenfolgen werden nicht unterstützt; Verwenden Sie bytes oder bytearray" +msgstr "Zeichenfolgen werden nicht unterstützt; verwende bytes oder bytearray" #: extmod/moductypes.c msgid "struct: can't index" @@ -4147,7 +4147,7 @@ msgstr "Zeitlimit beim warten auf v2 Karte" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "timer re-init" -msgstr "Timer wird neu initialisiert" +msgstr "Timer wird erneut initialisiert" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" From b46997fbcaa0527801c63d6a2d1938f41a3d470f Mon Sep 17 00:00:00 2001 From: Neradoc Date: Wed, 9 Nov 2022 16:30:17 +0000 Subject: [PATCH 063/357] Translated using Weblate (French) Currently translated at 99.2% (986 of 993 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 0bba3c5c6a..1ed13f401d 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-08-29 18:20+0000\n" -"Last-Translator: Maxime Leroy \n" +"PO-Revision-Date: 2022-11-09 19:20+0000\n" +"Last-Translator: Neradoc \n" "Language: fr\n" "MIME-Version: 1.0\n" "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.14.1-dev\n" +"X-Generator: Weblate 4.15-dev\n" #: main.c msgid "" @@ -73,7 +73,7 @@ msgstr "%%c nécessite un chiffre entier 'int' ou un caractère 'char'" #: main.c #, c-format msgid "%02X" -msgstr "" +msgstr "%02X" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1693,7 +1693,7 @@ msgstr "" #: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." -msgstr "" +msgstr "Une seul %q autorisée en sommeil profond." #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c @@ -2058,7 +2058,7 @@ msgstr "Délais de lecture de température dépassée" #: supervisor/shared/safe_mode.c msgid "The BOOT button was pressed at start up.\n" -msgstr "" +msgstr "Le bouton BOOT était pressé au démarrage.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2070,11 +2070,11 @@ msgstr "" #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "The SW38 button was pressed at start up.\n" -msgstr "" +msgstr "Le bouton SW38 était pressé au démarrage.\n" #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "The VOLUME button was pressed at start up.\n" -msgstr "" +msgstr "Le bouton VOLUME était pressé au démarrage.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2086,11 +2086,11 @@ msgstr "" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" -msgstr "" +msgstr "Le bouton central était pressé au démarrage.\n" #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "The left button was pressed at start up.\n" -msgstr "" +msgstr "Le bouton gauche était pressé au démarrage.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" @@ -2160,7 +2160,7 @@ msgstr "Le délai est trop long : le délai maximal est de %d secondes" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without requesting safe mode." -msgstr "" +msgstr "Pour le quitter, redémarrez sans demander le mode sans-échec." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2215,8 +2215,9 @@ msgid "UART write" msgstr "Écriture UART" #: main.c +#, fuzzy msgid "UID:" -msgstr "" +msgstr "UID:" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2284,7 +2285,7 @@ msgstr "Impossible de lancer la requête mDNS" #: shared-bindings/coproc/CoprocMemory.c msgid "Unable to write" -msgstr "" +msgstr "Écriture impossible" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2346,12 +2347,12 @@ msgstr "Faute inconnue du logiciel systême : %04x" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown system firmware error: %d" -msgstr "Erreur du firmware système inconnue : %d" +msgstr "Erreur du logiciel système inconnue : %d" #: ports/raspberrypi/common-hal/wifi/__init__.c #, c-format msgid "Unkown error code %d" -msgstr "" +msgstr "Erreur inconnue %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #, c-format @@ -3039,6 +3040,8 @@ msgid "" "esp32_camera.Camera requires reserved PSRAM to be configured. See the " "documentation for instructions." msgstr "" +"esp32_camera.Camera nécessite la configuration de PSRAM réservée. Se référer " +"à la documentation." #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -4293,7 +4296,7 @@ msgstr "type '%q' inconnu" #: py/objstr.c #, c-format msgid "unmatched '%c' in format" -msgstr "" +msgstr "'%c' sans correspondance dans le format" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4374,7 +4377,7 @@ msgstr "wifi n’est pas activé" #: ports/raspberrypi/common-hal/wifi/Monitor.c msgid "wifi.Monitor not available" -msgstr "" +msgstr "wifi.Monitor non disponible" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From 98ee03259c8e804db726cf69170bd6689b5219c1 Mon Sep 17 00:00:00 2001 From: Deleted User Date: Wed, 9 Nov 2022 15:52:46 +0000 Subject: [PATCH 064/357] Translated using Weblate (French) Currently translated at 99.2% (986 of 993 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 1ed13f401d..bc81a84ad3 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2022-11-09 19:20+0000\n" -"Last-Translator: Neradoc \n" +"Last-Translator: Deleted User \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -173,7 +173,7 @@ msgstr "%q doit être >= %d" #: shared-bindings/analogbufio/BufferedIn.c #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" -msgstr "" +msgstr "%q doit être a bytearray ou array de type 'h', 'H', 'b', ou 'B'" #: py/argcheck.c msgid "%q must be a string" @@ -602,7 +602,7 @@ msgstr "RX et TX requis pour le contrôle de flux" #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "Both buttons were pressed at start up.\n" -msgstr "" +msgstr "Les deux boutons étaient pressés au démarrage.\n" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -672,7 +672,7 @@ msgstr "La broche %d du bus est déjà utilisée" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "Button A was pressed at start up.\n" -msgstr "" +msgstr "Le bouton A était pressé au démarrage.\n" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -967,7 +967,7 @@ msgstr "Attendu un %q" #: ports/raspberrypi/bindings/cyw43/__init__.c msgid "Expected a %q or %q" -msgstr "" +msgstr "Attendu un %q ou %q" #: shared-bindings/alarm/__init__.c msgid "Expected an %q" @@ -1054,16 +1054,16 @@ msgstr "Filtres trop complexe" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is duplicate" -msgstr "" +msgstr "Le logiciel est identique" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is invalid" -msgstr "" +msgstr "Logiciel invalide" #: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" -msgstr "" +msgstr "Logiciel trop volumineux" #: shared-bindings/bitmaptools/__init__.c msgid "For L8 colorspace, input bitmap must have 8 bits per pixel" @@ -1597,11 +1597,11 @@ msgstr "Aucun minuteur disponible" #: supervisor/shared/safe_mode.c msgid "Nordic system firmware failure assertion." -msgstr "Assertion échouée du logiciel systême Nordic." +msgstr "Assertion échouée du logiciel système Nordic." #: ports/nrf/common-hal/_bleio/__init__.c msgid "Nordic system firmware out of memory" -msgstr "Logiciel systême Nordic hors de mémoire" +msgstr "Logiciel système Nordic n'a plus de mémoire" #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" @@ -1729,7 +1729,7 @@ msgstr "Timeout de l'opération" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" -msgstr "Hors de mémoire" +msgstr "Mémoire insuffisante" #: ports/espressif/common-hal/socketpool/Socket.c #: ports/raspberrypi/common-hal/socketpool/Socket.c @@ -2337,12 +2337,12 @@ msgstr "Erreur de sécurité inconnue : 0x%04x" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown system firmware error at %s:%d: %d" -msgstr "Erreur du firmware système inconnue à %s:%d : %d" +msgstr "Erreur du logiciel système inconnue à %s:%d : %d" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown system firmware error: %04x" -msgstr "Faute inconnue du logiciel systême : %04x" +msgstr "Faute inconnue du logiciel système : %04x" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format @@ -2509,7 +2509,7 @@ msgstr "Le paramêtre argsort doit être un ndarray" #: extmod/ulab/code/numpy/numerical.c msgid "argsort is not implemented for flattened arrays" -msgstr "argsort n'est pas mis en œuvre pour les matrices aplatis" +msgstr "argsort n'est pas implémenté pour les matrices aplaties" #: py/runtime.c shared-bindings/supervisor/__init__.c msgid "argument has wrong type" From 3910557605c4133e2f6e245a5b8aa69ea8909d72 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 9 Nov 2022 20:20:06 +0100 Subject: [PATCH 065/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 10 ++++++++++ locale/cs.po | 10 ++++++++++ locale/de_DE.po | 14 ++++++++++++-- locale/el.po | 10 ++++++++++ locale/en_GB.po | 10 ++++++++++ locale/es.po | 10 ++++++++++ locale/fil.po | 10 ++++++++++ locale/fr.po | 10 ++++++++++ locale/hi.po | 10 ++++++++++ locale/it_IT.po | 10 ++++++++++ locale/ja.po | 10 ++++++++++ locale/ko.po | 10 ++++++++++ locale/nl.po | 10 ++++++++++ locale/pl.po | 10 ++++++++++ locale/pt_BR.po | 10 ++++++++++ locale/ru.po | 10 ++++++++++ locale/sv.po | 10 ++++++++++ locale/tr.po | 10 ++++++++++ locale/zh_Latn_pinyin.po | 10 ++++++++++ 19 files changed, 192 insertions(+), 2 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 85089303e3..fe346373ef 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -3730,10 +3730,20 @@ msgid "offset out of bounds" msgstr "modul tidak ditemukan" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index c0a27df166..3ea4c2dcf3 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3716,10 +3716,20 @@ msgid "offset out of bounds" msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 99bc2e96df..d9c21c5742 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1142,8 +1142,8 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"Inkompatible .mpy-Datei. Bitte aktualisiere alle .mpy-Dateien. Siehe " -"http://adafru.it/mpy-update für weitere Informationen." +"Inkompatible .mpy-Datei. Bitte aktualisiere alle .mpy-Dateien. Siehe http://" +"adafru.it/mpy-update für weitere Informationen." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -3795,10 +3795,20 @@ msgid "offset out of bounds" msgstr "offset außerhalb der Grenzen" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "nur eine bit_depth=16 wird unterstützt" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "nur eine sample_rate=16000 wird unterstützt" diff --git a/locale/el.po b/locale/el.po index 6441c013b8..d47a0c5399 100644 --- a/locale/el.po +++ b/locale/el.po @@ -3725,10 +3725,20 @@ msgid "offset out of bounds" msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index f2941c143e..e6fabd93d9 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -3735,10 +3735,20 @@ msgid "offset out of bounds" msgstr "offset out of bounds" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "only bit_depth=16 is supported" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "only sample_rate=16000 is supported" diff --git a/locale/es.po b/locale/es.po index 477c7804d0..13cb9a3821 100644 --- a/locale/es.po +++ b/locale/es.po @@ -3782,10 +3782,20 @@ msgid "offset out of bounds" msgstr "offset fuera de límites" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "solo se admite bit_depth=16" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "solo se admite sample_rate=16000" diff --git a/locale/fil.po b/locale/fil.po index e6f7823269..f1e363b149 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -3734,10 +3734,20 @@ msgid "offset out of bounds" msgstr "wala sa sakop ang address" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index bc81a84ad3..2a4d6b230f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -3825,10 +3825,20 @@ msgid "offset out of bounds" msgstr "décalage hors limites" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "seul bit_depth = 16 est pris en charge" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "seul sample_rate = 16000 est pris en charge" diff --git a/locale/hi.po b/locale/hi.po index af78de1e3b..3c3496600b 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -3698,10 +3698,20 @@ msgid "offset out of bounds" msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 09d98d9ae5..e1ba5c3827 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -3745,10 +3745,20 @@ msgid "offset out of bounds" msgstr "indirizzo fuori limite" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index f647d9acc7..f0755961cf 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -3717,10 +3717,20 @@ msgid "offset out of bounds" msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "bit_depth=16のみ対応しています" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 8ec7ede284..4ec7ff804f 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -3702,10 +3702,20 @@ msgid "offset out of bounds" msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 990b6154df..fc1e1f77b8 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -3735,10 +3735,20 @@ msgid "offset out of bounds" msgstr "offset buiten bereik" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "alleen bit_depth=16 wordt ondersteund" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "alleen sample_rate=16000 wordt ondersteund" diff --git a/locale/pl.po b/locale/pl.po index 0f0ae884ec..22eacea387 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -3710,10 +3710,20 @@ msgid "offset out of bounds" msgstr "offset poza zakresem" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "obsługiwane jest tylko bit_depth=16" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "obsługiwane jest tylko sample_rate=16000" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 828e305c38..f59efab8c2 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3798,10 +3798,20 @@ msgid "offset out of bounds" msgstr "desvio fora dos limites" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "apenas bit_depth = 16 é compatível" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "apenas sample_rate = 16000 é compatível" diff --git a/locale/ru.po b/locale/ru.po index 8516515291..a575f05a40 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -3747,10 +3747,20 @@ msgid "offset out of bounds" msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 4c9bd6e193..9b4332e60b 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -3763,10 +3763,20 @@ msgid "offset out of bounds" msgstr "offset utanför gränserna" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "bara bit_depth=16 stöds" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "enbart sample_rate=16000 stöds" diff --git a/locale/tr.po b/locale/tr.po index 9734232c62..1d8eacdae0 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -3718,10 +3718,20 @@ msgid "offset out of bounds" msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index e1313e5b06..8dee6b5f2e 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -3763,10 +3763,20 @@ msgid "offset out of bounds" msgstr "piānlí biānjiè" #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" msgstr "Jǐn zhīchí wèi shēndù = 16" +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only mono is supported" +msgstr "" + +#: ports/stm/common-hal/audiobusio/PDMIn.c +msgid "only oversample=64 is supported" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c +#: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" From 5d974c35ee620e36efa2148a6f64e1e7df1b55f5 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Thu, 10 Nov 2022 08:31:27 +0530 Subject: [PATCH 066/357] update protomatter to latest commit --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index d0a07e14ad..cc93ff18c3 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit d0a07e14adcd71a7c22bcceb16c55aadb5e0d104 +Subproject commit cc93ff18c3a20b25396cb2babaee8ed33bb79528 From 1f332e70077b70eac3c41b41d6721b4a5014da4e Mon Sep 17 00:00:00 2001 From: Kyle McCreery Date: Wed, 9 Nov 2022 23:15:38 -0500 Subject: [PATCH 067/357] Adding pillbug initial commit --- ports/nrf/boards/pillbug/board.c | 29 ++++++++++ ports/nrf/boards/pillbug/mpconfigboard.h | 45 ++++++++++++++++ ports/nrf/boards/pillbug/mpconfigboard.mk | 8 +++ ports/nrf/boards/pillbug/pins.c | 64 +++++++++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 ports/nrf/boards/pillbug/board.c create mode 100644 ports/nrf/boards/pillbug/mpconfigboard.h create mode 100644 ports/nrf/boards/pillbug/mpconfigboard.mk create mode 100644 ports/nrf/boards/pillbug/pins.c diff --git a/ports/nrf/boards/pillbug/board.c b/ports/nrf/boards/pillbug/board.c new file mode 100644 index 0000000000..fb1ce4fb83 --- /dev/null +++ b/ports/nrf/boards/pillbug/board.c @@ -0,0 +1,29 @@ +/* + * 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/pillbug/mpconfigboard.h b/ports/nrf/boards/pillbug/mpconfigboard.h new file mode 100644 index 0000000000..d760b165d6 --- /dev/null +++ b/ports/nrf/boards/pillbug/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert 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 "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "PillBug" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P0_20) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_13) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_15) + +#define DEFAULT_SPI_BUS_SCK (&pin_P1_08) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_11) +#define DEFAULT_SPI_BUS_MISO (&pin_P0_26) + +#define DEFAULT_UART_BUS_RX (&pin_P0_08) +#define DEFAULT_UART_BUS_TX (&pin_P0_06) diff --git a/ports/nrf/boards/pillbug/mpconfigboard.mk b/ports/nrf/boards/pillbug/mpconfigboard.mk new file mode 100644 index 0000000000..d917ba0157 --- /dev/null +++ b/ports/nrf/boards/pillbug/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x16D0 +USB_PID = 0x10ED +USB_PRODUCT = "PillBug" +USB_MANUFACTURER = "Mechwild" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/pillbug/pins.c b/ports/nrf/boards/pillbug/pins.c new file mode 100644 index 0000000000..503d6b0f1b --- /dev/null +++ b/ports/nrf/boards/pillbug/pins.c @@ -0,0 +1,64 @@ +#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_P0_02), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P0_08), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_09), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P0_10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P0_17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P0_20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P0_22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P0_24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P0_26), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_P1_00), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P1_01), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_02), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_04), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_06), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_07), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_11), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, + + + { MP_ROM_QSTR(MP_QSTR_AIN0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_AIN7), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_04) }, // Read battery voltage divider + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_VCC_OFF), MP_ROM_PTR(&pin_P1_07) }, // External VCC by MOSFET + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_20) }, // Blue LED, HIGH sets to on + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_11) }, + + { MP_ROM_QSTR(MP_QSTR_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); From 8fdb2df0bf4ff6759e1b1ca5c8511f2531ece1f2 Mon Sep 17 00:00:00 2001 From: paul-1 <6473457+paul-1@users.noreply.github.com> Date: Sat, 29 Oct 2022 10:22:58 -0400 Subject: [PATCH 068/357] picow: enable dhcpserver for apmode. --- ports/raspberrypi/Makefile | 4 +++- shared/netutils/dhcpserver.c | 2 +- shared/netutils/netutils.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 5095c4c1f8..d7373642b3 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -65,7 +65,7 @@ INC_CYW43 := \ -isystem sdk/src/rp2_common/pico_cyw43_arch/include/ \ -isystem sdk/src/rp2_common/pico_lwip/include/ \ -CFLAGS_CYW43 := -DCYW43_LWIP=1 -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_USE_SPI -DIGNORE_GPIO25 -DIGNORE_GPIO23 -DIGNORE_GPIO24 -DCYW43_LOGIC_DEBUG=0 +CFLAGS_CYW43 := -DCYW43_LWIP=1 -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_USE_SPI -DIGNORE_GPIO25 -DIGNORE_GPIO23 -DIGNORE_GPIO24 -DCYW43_LOGIC_DEBUG=0 -DCYW43_NETUTILS=1 SRC_SDK_CYW43 := \ src/common/pico_sync/sem.c \ src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.c \ @@ -76,6 +76,8 @@ SRC_SDK_CYW43 := \ SRC_LWIP := \ shared/netutils/netutils.c \ + shared/netutils/trace.c \ + shared/netutils/dhcpserver.c \ $(wildcard lib/lwip/src/core/*.c) \ $(wildcard lib/lwip/src/core/ipv4/*.c) \ lib/lwip/src/netif/ethernet.c \ diff --git a/shared/netutils/dhcpserver.c b/shared/netutils/dhcpserver.c index 9db42b3fd9..a61501c93c 100644 --- a/shared/netutils/dhcpserver.c +++ b/shared/netutils/dhcpserver.c @@ -33,7 +33,7 @@ #include "py/mperrno.h" #include "py/mphal.h" -#if MICROPY_PY_LWIP +#if LWIP_UDP #include "shared/netutils/dhcpserver.h" #include "lwip/udp.h" diff --git a/shared/netutils/netutils.h b/shared/netutils/netutils.h index b23a78e5b8..3bb9212800 100644 --- a/shared/netutils/netutils.h +++ b/shared/netutils/netutils.h @@ -33,6 +33,8 @@ #define NETUTILS_TRACE_PAYLOAD (0x0002) #define NETUTILS_TRACE_NEWLINE (0x0004) +#include "py/runtime.h" + typedef enum _netutils_endian_t { NETUTILS_LITTLE, NETUTILS_BIG, From 851c2cd8cb691587e53b874752e92ee14a04ae6c Mon Sep 17 00:00:00 2001 From: paul-1 <6473457+paul-1@users.noreply.github.com> Date: Sat, 29 Oct 2022 15:20:10 -0400 Subject: [PATCH 069/357] picow: Add channel setting when starting AP --- ports/raspberrypi/common-hal/wifi/Radio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 9c2dea85c7..1c92aaea87 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -174,6 +174,10 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ // Is there a better way? common_hal_wifi_radio_stop_station(self); + // Channel can only be changed after inital powerup and config of ap. + // Defaults to 1 if not set or invalid (i.e. 13) + cyw43_wifi_ap_set_channel(&cyw43_state, (const uint32_t)channel); + cyw43_arch_enable_ap_mode((const char *)ssid, (const char *)password, CYW43_AUTH_WPA2_AES_PSK); // TODO: Implement authmode check like in espressif bindings_cyw43_wifi_enforce_pm(); From 11f1174658dbbfae9f8b257feda894befa774113 Mon Sep 17 00:00:00 2001 From: paul-1 <6473457+paul-1@users.noreply.github.com> Date: Sat, 29 Oct 2022 15:30:57 -0400 Subject: [PATCH 070/357] picow: Change init to use country code routine.....place holder for future improvements to allow country code setting. --- ports/raspberrypi/supervisor/port.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 781d2b11d2..be7afcac86 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -140,7 +140,9 @@ safe_mode_t port_init(void) { never_reset_pin_number(24); never_reset_pin_number(25); never_reset_pin_number(29); - if (cyw43_arch_init()) { + // Change this as a placeholder as to how to init with country code. + // Default country code is CYW43_COUNTRY_WORLDWIDE) + if (cyw43_arch_init_with_country(PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE)) { serial_write("WiFi init failed\n"); } else { cyw_ever_init = true; From 19df394437f6f041b293891a8b517320fe012008 Mon Sep 17 00:00:00 2001 From: dronecz Date: Thu, 10 Nov 2022 21:14:01 +0000 Subject: [PATCH 071/357] Adding frozen modules --- .gitmodules | 6 ++++++ frozen/Adafruit_CircuitPython_SSD1680 | 1 + frozen/Adafruit_CircuitPython_UC8151D | 1 + 3 files changed, 8 insertions(+) create mode 160000 frozen/Adafruit_CircuitPython_SSD1680 create mode 160000 frozen/Adafruit_CircuitPython_UC8151D diff --git a/.gitmodules b/.gitmodules index 0d521b5ff0..f13eb79e45 100644 --- a/.gitmodules +++ b/.gitmodules @@ -319,3 +319,9 @@ [submodule "lib/mbedtls"] path = lib/mbedtls url = https://github.com/ARMmbed/mbedtls.git +[submodule "frozen/Adafruit_CircuitPython_UC8151D"] + path = frozen/Adafruit_CircuitPython_UC8151D + url = https://github.com/adafruit/Adafruit_CircuitPython_UC8151D +[submodule "frozen/Adafruit_CircuitPython_SSD1680"] + path = frozen/Adafruit_CircuitPython_SSD1680 + url = https://github.com/adafruit/Adafruit_CircuitPython_SSD1680 diff --git a/frozen/Adafruit_CircuitPython_SSD1680 b/frozen/Adafruit_CircuitPython_SSD1680 new file mode 160000 index 0000000000..adff47d7be --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SSD1680 @@ -0,0 +1 @@ +Subproject commit adff47d7be2a430b20e5ebcc59cb4e5a38fc171c diff --git a/frozen/Adafruit_CircuitPython_UC8151D b/frozen/Adafruit_CircuitPython_UC8151D new file mode 160000 index 0000000000..a64fad692c --- /dev/null +++ b/frozen/Adafruit_CircuitPython_UC8151D @@ -0,0 +1 @@ +Subproject commit a64fad692cc83fa1ac48b8f5ab1a955fd9b39251 From 0bf9df232a91aa209ee01ac571419d62acbd3a0b Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 11 Nov 2022 14:17:57 +0200 Subject: [PATCH 072/357] fix debug --- ports/raspberrypi/common-hal/wifi/Radio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 3e95ae5cd1..ff0549c14d 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -46,6 +46,7 @@ #include "components/mdns/include/mdns.h" #endif +#include "lwip/sys.h" #include "lwip/dns.h" #include "lwip/icmp.h" #include "lwip/raw.h" @@ -55,6 +56,15 @@ #define PING_ID 0xAFAF #endif +#ifndef PING_DEBUG +#define PING_DEBUG LWIP_DBG_ON +#endif + +#ifdef LWIP_DEBUG +static u32_t ping_time; +#endif + + #define MAC_ADDRESS_LENGTH 6 #define NETIF_STA (&cyw43_state.netif[CYW43_ITF_STA]) From e6a4e2982f670828d35c4265e746e88d4bf461ff Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 11 Nov 2022 14:40:47 +0200 Subject: [PATCH 073/357] Update ports/raspberrypi/common-hal/wifi/Radio.c u32_t -> uint32_t Co-authored-by: MicroDev <70126934+MicroDev1@users.noreply.github.com> --- ports/raspberrypi/common-hal/wifi/Radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index ff0549c14d..8073f57063 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -61,7 +61,7 @@ #endif #ifdef LWIP_DEBUG -static u32_t ping_time; +static uint32_t ping_time; #endif From f5c637dc10e2374ca1282cbc430c94fc0973b2f6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 10 Nov 2022 11:02:31 -0600 Subject: [PATCH 074/357] Add adafruit_pixelmap.PixelMap .. a fast helper for animations. It is similar to and inspired by the PixelMap helper in Adafruit LED Animation library, but with an extremely fast 'paste' method for setting a series of pixels. This is a common operation for many animations, and can give a substantial speed improvement. It's named `adafruit_pixelmap` so that we can package a compatible version in pure Python for systems that can't fit it in C in flash, or for Blinka. This is a proof of concept and can make a very fast comet animation: ```python import time import adafruit_pixelbuf import adafruti_pixelmap import board import neopixel from supervisor import ticks_ms from adafruit_led_animation.animation.solid import Solid from adafruit_led_animation import color pixel_pin = board.GP0 pixel_num = 96 pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=1, auto_write=False, pixel_order="RGB") evens = adafruit_pixelmap.PixelMap(pixels, tuple(range(0, pixel_num, 2))) odd_indices = tuple((i, i+2) for i in range(1, pixel_num, 4)) print(odd_indices) odds = adafruit_pixelbuf.PixelMap(pixels, odd_indices) assert len(odds) == len(odd_indices) comet_length = 16 comet1 = [color.calculate_intensity(color.GREEN, ((1+i) / comet_length) ** 2.4) for i in range(comet_length)] comet2 = [color.calculate_intensity(color.PURPLE, ((1+i) / comet_length) ** 2.4) for i in range(comet_length)] pos1 = 0 pos2 = 96//4 while True: evens.paste(comet1, pos1, wrap=True, reverse=False, others=0) pos1 = (pos1 + 1) % len(evens) odds.paste(comet2, pos2, wrap=True, reverse=True, others=0) pos2 = (pos2 - 1) % len(odds) pixels.show() m = ticks_ms() if m % 2000 > 1000: time.sleep(.02) ``` --- locale/circuitpython.pot | 9 + ports/atmel-samd/mpconfigport.mk | 1 + .../aramcon_badge_2019/mpconfigboard.mk | 1 + py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/adafruit_pixelbuf/PixelBuf.c | 28 +- shared-bindings/adafruit_pixelbuf/PixelBuf.h | 3 + shared-bindings/adafruit_pixelbuf/__init__.c | 9 + shared-bindings/adafruit_pixelmap/PixelMap.c | 245 ++++++++++++++++++ shared-bindings/adafruit_pixelmap/PixelMap.h | 42 +++ shared-bindings/adafruit_pixelmap/__init__.c | 62 +++++ shared-bindings/adafruit_pixelmap/__init__.h | 30 +++ shared-module/adafruit_pixelbuf/PixelBuf.c | 21 +- shared-module/adafruit_pixelbuf/PixelBuf.h | 6 +- shared-module/adafruit_pixelmap/PixelMap.c | 184 +++++++++++++ shared-module/adafruit_pixelmap/PixelMap.h | 39 +++ shared-module/adafruit_pixelmap/__init__.c | 0 17 files changed, 658 insertions(+), 30 deletions(-) create mode 100644 shared-bindings/adafruit_pixelmap/PixelMap.c create mode 100644 shared-bindings/adafruit_pixelmap/PixelMap.h create mode 100644 shared-bindings/adafruit_pixelmap/__init__.c create mode 100644 shared-bindings/adafruit_pixelmap/__init__.h create mode 100644 shared-module/adafruit_pixelmap/PixelMap.c create mode 100644 shared-module/adafruit_pixelmap/PixelMap.h create mode 100644 shared-module/adafruit_pixelmap/__init__.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 779a75deb6..382aa710c5 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2267,6 +2267,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3152,6 +3153,10 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c @@ -3537,6 +3542,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index e6f5759f1c..05aed89eb2 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -42,6 +42,7 @@ CIRCUITPY_I2CTARGET ?= 0 CIRCUITPY_JSON ?= 0 CIRCUITPY_KEYPAD ?= 0 CIRCUITPY_MSGPACK ?= 0 +CIRCUITPY_PIXELMAP ?= 0 CIRCUITPY_RE ?= 0 CIRCUITPY_SDCARDIO ?= 0 CIRCUITPY_SYNTHIO ?= 0 diff --git a/ports/nrf/boards/aramcon_badge_2019/mpconfigboard.mk b/ports/nrf/boards/aramcon_badge_2019/mpconfigboard.mk index 06cd9633d1..5bf2eb721b 100644 --- a/ports/nrf/boards/aramcon_badge_2019/mpconfigboard.mk +++ b/ports/nrf/boards/aramcon_badge_2019/mpconfigboard.mk @@ -9,5 +9,6 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "GD25Q16C" CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_PIXELMAP = 0 CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index ee51a58c58..0d70068e43 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -266,6 +266,9 @@ endif ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += adafruit_pixelbuf/% endif +ifeq ($(CIRCUITPY_PIXELMAP),1) +SRC_PATTERNS += adafruit_pixelmap/% +endif ifeq ($(CIRCUITPY_QRIO),1) SRC_PATTERNS += qrio/% endif @@ -543,6 +546,8 @@ SRC_SHARED_MODULE_ALL = \ _eve/__init__.c \ adafruit_pixelbuf/PixelBuf.c \ adafruit_pixelbuf/__init__.c \ + adafruit_pixelmap/PixelMap.c \ + adafruit_pixelmap/__init__.c \ _stage/Layer.c \ _stage/Text.c \ _stage/__init__.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index fbf0b587b7..3ca23263d4 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -319,6 +319,9 @@ CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW) CIRCUITPY_PIXELBUF ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF) +CIRCUITPY_PIXELMAP ?= $(CIRCUITPY_PIXELBUF) +CFLAGS += -DCIRCUITPY_PIXELMAP=$(CIRCUITPY_PIXELMAP) + # Only for SAMD boards for the moment CIRCUITPY_PS2IO ?= 0 CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO) diff --git a/shared-bindings/adafruit_pixelbuf/PixelBuf.c b/shared-bindings/adafruit_pixelbuf/PixelBuf.c index 6203f672ad..2efde4cafc 100644 --- a/shared-bindings/adafruit_pixelbuf/PixelBuf.c +++ b/shared-bindings/adafruit_pixelbuf/PixelBuf.c @@ -253,9 +253,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_show(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_show_obj, pixelbuf_pixelbuf_show); -//| def fill( -//| self, color: Union[int, Tuple[int, int, int], Tuple[int, int, int, float]] -//| ) -> None: +//| def fill(self, color: PixelType) -> None: //| """Fills the given pixelbuf with the given color.""" //| ... @@ -267,29 +265,21 @@ STATIC mp_obj_t pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t value) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(pixelbuf_pixelbuf_fill_obj, pixelbuf_pixelbuf_fill); //| @overload -//| def __getitem__( -//| self, index: slice -//| ) -> Union[Tuple[Tuple[int, int, int], ...], Tuple[Tuple[int, int, int, float], ...]]: ... -//| @overload -//| def __getitem__( -//| self, index: int -//| ) -> Union[Tuple[int, int, int], Tuple[int, int, int, float]]: +//| def __getitem__(self, index: slice) -> PixelReturnSequence: //| """Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values //| between 0 and 255. When in PWM (DotStar) mode, the 4th tuple value is a float of the pixel //| intensity from 0-1.0.""" //| ... //| @overload -//| def __setitem__( -//| self, index: slice, value: Tuple[Union[int, Tuple[float, ...], List[float]], ...] -//| ) -> None: ... +//| def __getitem__(self, index: int) -> PixelReturnType: +//| """Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values +//| between 0 and 255. When in PWM (DotStar) mode, the 4th tuple value is a float of the pixel +//| intensity from 0-1.0.""" +//| ... //| @overload -//| def __setitem__( -//| self, index: slice, value: List[Union[int, Tuple[float, ...], List[float]]] -//| ) -> None: ... +//| def __setitem__(self, index: slice, value: PixelSequence) -> None: ... //| @overload -//| def __setitem__( -//| self, index: int, value: Union[int, Tuple[float, ...], List[float]] -//| ) -> None: +//| def __setitem__(self, index: int, value: PixelType) -> None: //| """Sets the pixel value at the given index. Value can either be a tuple or integer. Tuples are //| The individual (Red, Green, Blue[, White]) values between 0 and 255. If given an integer, the //| red, green and blue values are packed into the lower three bytes (0xRRGGBB). diff --git a/shared-bindings/adafruit_pixelbuf/PixelBuf.h b/shared-bindings/adafruit_pixelbuf/PixelBuf.h index 7ae3d6acf8..88eb06f0a0 100644 --- a/shared-bindings/adafruit_pixelbuf/PixelBuf.h +++ b/shared-bindings/adafruit_pixelbuf/PixelBuf.h @@ -27,6 +27,7 @@ #ifndef CP_SHARED_BINDINGS_PIXELBUF_PIXELBUF_H #define CP_SHARED_BINDINGS_PIXELBUF_PIXELBUF_H +#include "py/objtuple.h" #include "shared-module/adafruit_pixelbuf/PixelBuf.h" extern const mp_obj_type_t pixelbuf_pixelbuf_type; @@ -48,5 +49,7 @@ void common_hal_adafruit_pixelbuf_pixelbuf_show(mp_obj_t self); mp_obj_t common_hal_adafruit_pixelbuf_pixelbuf_get_pixel(mp_obj_t self, size_t index); void common_hal_adafruit_pixelbuf_pixelbuf_set_pixel(mp_obj_t self, size_t index, mp_obj_t item); void common_hal_adafruit_pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t *values, mp_obj_tuple_t *flatten_to); +void common_hal_adafruit_pixelbuf_pixelbuf_parse_color(mp_obj_t self, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w); +void common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(mp_obj_t self, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w); #endif // CP_SHARED_BINDINGS_PIXELBUF_PIXELBUF_H diff --git a/shared-bindings/adafruit_pixelbuf/__init__.c b/shared-bindings/adafruit_pixelbuf/__init__.c index 40bf80094c..fd2915ee0a 100644 --- a/shared-bindings/adafruit_pixelbuf/__init__.c +++ b/shared-bindings/adafruit_pixelbuf/__init__.c @@ -39,6 +39,15 @@ //| RGB(W) strip/matrix manipulation, such as DotStar and Neopixel. //| //| Byteorders are configured with strings, such as "RGB" or "RGBD".""" +//| +//| # The types accepted when getting a pixel value +//| PixelReturnType = Union[ +//| Tuple[int, int, int], Tuple[int, int, int, int], Tuple[int, int, int, float] +//| ] +//| PixelReturnSequence = Tuple[PixelReturnType] +//| # The types returned when getting a pixel value +//| PixelType = Union[int, PixelReturnType] +//| PixelSequence = Union[Tuple[PixelType], List[PixelType]] // TODO: Pull in docs from adafruit_pixelbuf. STATIC const mp_rom_map_elem_t pixelbuf_module_globals_table[] = { diff --git a/shared-bindings/adafruit_pixelmap/PixelMap.c b/shared-bindings/adafruit_pixelmap/PixelMap.c new file mode 100644 index 0000000000..3361534ca1 --- /dev/null +++ b/shared-bindings/adafruit_pixelmap/PixelMap.c @@ -0,0 +1,245 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Rose Hooper + * Copyright (c) 2022 Jeff Epler 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 "py/objproperty.h" +#include "py/objtype.h" +#include "py/runtime.h" + +#include "shared-bindings/adafruit_pixelmap/PixelMap.h" +#include "shared-bindings/adafruit_pixelbuf/PixelBuf.h" +#include "shared-module/adafruit_pixelmap/PixelMap.h" + +//| from adafruit_pixelbuf import PixelBuf, PixelReturnType, PixelSequence, PixelType +//| +//| class PixelMap: +//| def __init__(self, pixelbuf: PixelBuf, indices: Tuple[Union[int, Tuple[int]]]) -> None: +//| """Construct a PixelMap object that uses the given indices of the underlying pixelbuf""" + +STATIC mp_obj_t pixelmap_pixelmap_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { + enum { ARG_pixelbuf, ARG_indices }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_pixelbuf, MP_ARG_REQUIRED }, + { MP_QSTR_indices, MP_ARG_REQUIRED }, + }; + + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_obj_t pixelbuf = args[ARG_pixelbuf].u_obj; + + mp_obj_t native_pixelbuf = mp_obj_cast_to_native_base(pixelbuf, &pixelbuf_pixelbuf_type); + if (!native_pixelbuf) { + (void)mp_arg_validate_type(args[ARG_pixelbuf].u_obj, &pixelbuf_pixelbuf_type, MP_QSTR_pixelbuf); + } + mp_obj_assert_native_inited(native_pixelbuf); + + size_t buflen = common_hal_adafruit_pixelbuf_pixelbuf_get_len(pixelbuf); + + mp_obj_t indices = mp_arg_validate_type(args[ARG_indices].u_obj, &mp_type_tuple, MP_QSTR_indices); + + // validate indices + size_t len; + mp_obj_t *items; + mp_obj_tuple_get(indices, &len, &items); + mp_arg_validate_length_min(len, 1, MP_QSTR_items); + + for (size_t i = 0; i < len; i++) { + mp_obj_t item = items[i]; + if (mp_obj_is_small_int(item)) { + mp_arg_validate_index_range(MP_OBJ_SMALL_INT_VALUE(item), 0, buflen - 1, MP_QSTR_index); + } else if (mp_obj_is_tuple_compatible(item)) { + size_t len1; + mp_obj_t *items1; + mp_obj_tuple_get(item, &len1, &items1); + for (size_t j = 0; j < len1; j++) { + mp_obj_t item1 = items1[j]; + if (!mp_obj_is_small_int(item1)) { + mp_raise_TypeError(translate("nested index must be int")); + } + mp_arg_validate_index_range(MP_OBJ_SMALL_INT_VALUE(item1), 0, buflen - 1, MP_QSTR_index); + } + } else { + mp_raise_TypeError(translate("index must be tuple or int")); + } + } + + pixelmap_pixelmap_obj_t *self = m_new_obj(pixelmap_pixelmap_obj_t); + self->base.type = &pixelmap_pixelmap_type; + shared_module_pixelmap_pixelmap_construct(self, pixelbuf, indices); + + return MP_OBJ_FROM_PTR(self); +} + +//| auto_write: bool +//| """True if updates should be automatically written""" +STATIC mp_obj_t pixelmap_pixelmap_auto_write_get(const mp_obj_t self_in) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(shared_module_pixelmap_pixelmap_auto_write_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(pixelmap_pixelmap_auto_write_get_obj, pixelmap_pixelmap_auto_write_get); + +STATIC mp_obj_t pixelmap_pixelmap_auto_write_set(const mp_obj_t self_in, const mp_obj_t arg) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + shared_module_pixelmap_pixelmap_auto_write_set(self, mp_obj_is_true(arg)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(pixelmap_pixelmap_auto_write_set_obj, pixelmap_pixelmap_auto_write_set); + +MP_PROPERTY_GETSET(pixelmap_pixelmap_auto_write_obj, + (mp_obj_t)&pixelmap_pixelmap_auto_write_get_obj, + (mp_obj_t)&pixelmap_pixelmap_auto_write_set_obj); + +//| bpp: int +//| """The number of bytes per pixel in the buffer (read-only)""" +STATIC mp_obj_t pixelmap_pixelmap_obj_get_bpp(mp_obj_t self_in) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_adafruit_pixelbuf_pixelbuf_get_bpp(self->pixelbuf)); +} +MP_DEFINE_CONST_FUN_OBJ_1(pixelmap_pixelmap_get_bpp_obj, pixelmap_pixelmap_obj_get_bpp); + +MP_PROPERTY_GETTER(pixelmap_pixelmap_bpp_obj, + (mp_obj_t)&pixelmap_pixelmap_get_bpp_obj); + +//| byteorder: str +//| """byteorder string for the buffer (read-only)""" +STATIC mp_obj_t pixelmap_pixelmap_obj_get_byteorder(mp_obj_t self_in) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + return common_hal_adafruit_pixelbuf_pixelbuf_get_byteorder_string(self->pixelbuf); +} +MP_DEFINE_CONST_FUN_OBJ_1(pixelmap_pixelmap_get_byteorder, pixelmap_pixelmap_obj_get_byteorder); +MP_PROPERTY_GETTER(pixelmap_pixelmap_byteorder_obj, + (mp_obj_t)&pixelmap_pixelmap_get_byteorder); + +//| +//| def fill(self, color: PixelType, /) -> None: +//| """Fill all the pixels in the map with the given color""" +STATIC mp_obj_t pixelmap_pixelmap_fill(const mp_obj_t self_in, const mp_obj_t color) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + + shared_module_pixelmap_pixelmap_fill(self, color); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(pixelmap_pixelmap_fill_obj, pixelmap_pixelmap_fill); + +//| +//| def indices(self, index: int, /) -> Tuple[int]: +//| """Return the PixelBuf indices for a PixelMap index""" +STATIC mp_obj_t pixelmap_pixelmap_indices(const mp_obj_t self_in, const mp_obj_t index) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + + return shared_module_pixelmap_pixelmap_indices(self, mp_obj_get_int(index)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(pixelmap_pixelmap_indices_obj, pixelmap_pixelmap_indices); + + +//| def __getitem__(self, index: int) -> PixelReturnType: +//| """Retrieve the value of one of the underlying pixels at 'index'. +//| +//| Note that slices are not supported by PixelMap.__getitem__""" +//| @overload +//| def __setitem__(self, index: slice, value: PixelSequence) -> None: ... +//| @overload +//| def __setitem__(self, index: int, value: PixelType) -> None: +//| """Sets the pixel value at the given index. Value can either be a tuple or integer. Tuples are +//| The individual (Red, Green, Blue[, White]) values between 0 and 255. If given an integer, the +//| red, green and blue values are packed into the lower three bytes (0xRRGGBB). +//| For RGBW byteorders, if given only RGB values either as an int or as a tuple, the white value +//| is used instead when the red, green, and blue values are the same.""" +//| ... +STATIC mp_obj_t pixelmap_pixelmap_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + if (value == MP_OBJ_NULL) { + // delete + return MP_OBJ_NULL; // op not supported + } else if (value == MP_OBJ_SENTINEL) { + int index = mp_obj_get_int(index_in); + return shared_module_pixelmap_pixelmap_getitem(self, index); + } + + // get + if (0) { + #if MICROPY_PY_BUILTINS_SLICE + } else if (mp_obj_is_type(index_in, &mp_type_slice)) { + shared_module_pixelmap_pixelmap_setslice(self, index_in, value); + #endif + } else { + shared_module_pixelmap_pixelmap_setitem(self, mp_obj_get_int(index_in), value); + } + return mp_const_none; +} + +//| def __len__(self) -> int: +//| """Length of the map""" +STATIC mp_obj_t pixelmap_pixelmap_unary_op(mp_unary_op_t op, mp_obj_t self_in) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + switch (op) { + case MP_UNARY_OP_BOOL: + return mp_const_true; + case MP_UNARY_OP_LEN: + return MP_OBJ_NEW_SMALL_INT(self->len); + default: + return MP_OBJ_NULL; // op not supported + } +} + +//| def show(self) -> None: +//| """Transmits the color data to the pixels so that they are shown. This is done automatically +//| when `auto_write` is True.""" +//| ... +//| + +STATIC mp_obj_t pixelmap_pixelmap_show(mp_obj_t self_in) { + pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_adafruit_pixelbuf_pixelbuf_show(self->pixelbuf); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelmap_pixelmap_show_obj, pixelmap_pixelmap_show); + +STATIC const mp_rom_map_elem_t pixelmap_pixelmap_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_auto_write), MP_ROM_PTR(&pixelmap_pixelmap_auto_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_bpp), MP_ROM_PTR(&pixelmap_pixelmap_bpp_obj) }, + { MP_ROM_QSTR(MP_QSTR_byteorder), MP_ROM_PTR(&pixelmap_pixelmap_byteorder_obj) }, + { MP_ROM_QSTR(MP_QSTR_fill), MP_ROM_PTR(&pixelmap_pixelmap_fill_obj) }, + { MP_ROM_QSTR(MP_QSTR_indices), MP_ROM_PTR(&pixelmap_pixelmap_indices_obj) }, + { MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&pixelmap_pixelmap_show_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(pixelmap_pixelmap_locals_dict, pixelmap_pixelmap_locals_dict_table); + + +const mp_obj_type_t pixelmap_pixelmap_type = { + { &mp_type_type }, + .name = MP_QSTR_PixelMap, + .flags = MP_TYPE_FLAG_EXTENDED, + .locals_dict = (mp_obj_t)&pixelmap_pixelmap_locals_dict, + .make_new = pixelmap_pixelmap_make_new, + MP_TYPE_EXTENDED_FIELDS( + .subscr = pixelmap_pixelmap_subscr, + .unary_op = pixelmap_pixelmap_unary_op, + ), +}; diff --git a/shared-bindings/adafruit_pixelmap/PixelMap.h b/shared-bindings/adafruit_pixelmap/PixelMap.h new file mode 100644 index 0000000000..420df1b9e9 --- /dev/null +++ b/shared-bindings/adafruit_pixelmap/PixelMap.h @@ -0,0 +1,42 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Rose Hooper + * Copyright (c) 2022 Jeff Epler 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. + */ + +#pragma once +#include "py/obj.h" + +extern const mp_obj_type_t pixelmap_pixelmap_type; + +typedef struct _pixelmap_pixelmap_obj pixelmap_pixelmap_obj_t; + +void shared_module_pixelmap_pixelmap_construct(pixelmap_pixelmap_obj_t *self, mp_obj_t pixelbuf, mp_obj_t indices); +bool shared_module_pixelmap_pixelmap_auto_write_get(pixelmap_pixelmap_obj_t *self); +void shared_module_pixelmap_pixelmap_auto_write_set(pixelmap_pixelmap_obj_t *self, bool auto_write); +void shared_module_pixelmap_pixelmap_fill(pixelmap_pixelmap_obj_t *self, const mp_obj_t color); +mp_obj_t shared_module_pixelmap_pixelmap_indices(pixelmap_pixelmap_obj_t *self, int index); +void shared_module_pixelmap_pixelmap_setslice(pixelmap_pixelmap_obj_t *self, const mp_obj_t slice_in, const mp_obj_t value); +mp_obj_t shared_module_pixelmap_pixelmap_getitem(pixelmap_pixelmap_obj_t *self, mp_int_t index); +void shared_module_pixelmap_pixelmap_setitem(pixelmap_pixelmap_obj_t *self, mp_int_t index, const mp_obj_t value); diff --git a/shared-bindings/adafruit_pixelmap/__init__.c b/shared-bindings/adafruit_pixelmap/__init__.c new file mode 100644 index 0000000000..7b10471c83 --- /dev/null +++ b/shared-bindings/adafruit_pixelmap/__init__.c @@ -0,0 +1,62 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Rose Hooper + * + * 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 "py/obj.h" +#include "py/mphal.h" +#include "py/runtime.h" +#include "py/objproperty.h" + +#include "shared-bindings/adafruit_pixelmap/__init__.h" +#include "shared-bindings/adafruit_pixelmap/PixelMap.h" + + +//| """A fast pixel mapping library +//| +//| The `adafruit_pixelmap` module provides the :py:class:`PixelMap` class to accelerate +//| RGB(W) strip/matrix manipulation, such as DotStar and Neopixel.""" +//| +//| # The types accepted when getting a pixel value +//| PixelReturnType = Union[ +//| Tuple[int, int, int], Tuple[int, int, int, int], Tuple[int, int, int, float] +//| ] +//| PixelReturnSequence = Tuple[PixelReturnType] +//| # The types returned when getting a pixel value +//| PixelType = Union[int, PixelReturnType] +//| PixelSequence = Union[Tuple[PixelType], List[PixelType]] + +STATIC const mp_rom_map_elem_t pixelmap_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_adafruit_pixelmap) }, + { MP_ROM_QSTR(MP_QSTR_PixelMap), MP_ROM_PTR(&pixelmap_pixelmap_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(pixelmap_module_globals, pixelmap_module_globals_table); + +const mp_obj_module_t pixelmap_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&pixelmap_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_adafruit_pixelmap, pixelmap_module, CIRCUITPY_PIXELMAP); diff --git a/shared-bindings/adafruit_pixelmap/__init__.h b/shared-bindings/adafruit_pixelmap/__init__.h new file mode 100644 index 0000000000..9a84bc68a7 --- /dev/null +++ b/shared-bindings/adafruit_pixelmap/__init__.h @@ -0,0 +1,30 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Rose Hooper + * + * 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. + */ + +#ifndef CP_SHARED_BINDINGS_PIXELBUF_INIT_H +#define CP_SHARED_BINDINGS_PIXELBUF_INIT_H + +#endif // CP_SHARED_BINDINGS_PIXELBUF_INIT_H diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index cab97feace..72f03c6b26 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -152,7 +152,7 @@ STATIC uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { translate("can't convert %q to %q"), mp_obj_get_type_qstr(obj), MP_QSTR_int); } -STATIC void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w) { +static void pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w) { pixelbuf_byteorder_details_t *byteorder = &self->byteorder; // w is shared between white in NeoPixels and brightness in dotstars (so that DotStars can have // per-pixel brightness). Set the defaults here in case it isn't set below. @@ -195,7 +195,12 @@ STATIC void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, } } -STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { +void common_hal_adafruit_pixelbuf_pixelbuf_parse_color(mp_obj_t self_in, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w) { + pixelbuf_pixelbuf_obj_t *self = native_pixelbuf(self_in); + pixelbuf_parse_color(self, color, r, g, b, w); +} + +static void pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { // DotStars don't have white, instead they have 5 bit brightness so pack it into w. Shift right // by three to leave the top five bits. if (self->bytes_per_pixel == 4 && self->byteorder.is_dotstar) { @@ -232,14 +237,18 @@ STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t inde scaled_buffer[rgbw_order->b] = (b * self->scaled_brightness) / 256; } } +void common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(mp_obj_t self_in, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { + pixelbuf_pixelbuf_obj_t *self = native_pixelbuf(self_in); + pixelbuf_set_pixel_color(self, index, r, g, b, w); +} STATIC void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t *self, size_t index, mp_obj_t value) { uint8_t r; uint8_t g; uint8_t b; uint8_t w; - _pixelbuf_parse_color(self, value, &r, &g, &b, &w); - _pixelbuf_set_pixel_color(self, index, r, g, b, w); + common_hal_adafruit_pixelbuf_pixelbuf_parse_color(self, value, &r, &g, &b, &w); + common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(self, index, r, g, b, w); } void common_hal_adafruit_pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t *values, @@ -322,10 +331,10 @@ void common_hal_adafruit_pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t fill_ uint8_t g; uint8_t b; uint8_t w; - _pixelbuf_parse_color(self, fill_color, &r, &g, &b, &w); + common_hal_adafruit_pixelbuf_pixelbuf_parse_color(self, fill_color, &r, &g, &b, &w); for (size_t i = 0; i < self->pixel_count; i++) { - _pixelbuf_set_pixel_color(self, i, r, g, b, w); + common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(self, i, r, g, b, w); } if (self->auto_write) { common_hal_adafruit_pixelbuf_pixelbuf_show(self_in); diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.h b/shared-module/adafruit_pixelbuf/PixelBuf.h index b526254f29..a4a753baa0 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.h +++ b/shared-module/adafruit_pixelbuf/PixelBuf.h @@ -24,13 +24,11 @@ * THE SOFTWARE. */ +#pragma once #include "py/obj.h" #include "py/objarray.h" -#ifndef PIXELBUF_SHARED_MODULE_H -#define PIXELBUF_SHARED_MODULE_H - typedef struct { uint8_t r; uint8_t g; @@ -68,5 +66,3 @@ typedef struct { #define DOTSTAR_LED_START 0b11100000 #define DOTSTAR_LED_START_FULL_BRIGHT 0xFF - -#endif diff --git a/shared-module/adafruit_pixelmap/PixelMap.c b/shared-module/adafruit_pixelmap/PixelMap.c new file mode 100644 index 0000000000..6897b172af --- /dev/null +++ b/shared-module/adafruit_pixelmap/PixelMap.c @@ -0,0 +1,184 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Rose Hooper + * Copyright (c) 2022 Jeff Epler 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 "py/smallint.h" +#include "py/runtime.h" + +#include "shared-bindings/adafruit_pixelmap/PixelMap.h" +#include "shared-bindings/adafruit_pixelbuf/PixelBuf.h" +#include "shared-module/adafruit_pixelmap/PixelMap.h" + +typedef union { + uint32_t rgbw; + struct { + uint8_t r, g, b, w; + }; +} color_u; + +static void pixelmap_set_pixel_rgbw(pixelmap_pixelmap_obj_t *self, size_t i, color_u rgbw) { + mp_arg_validate_index_range(i, 0, self->len, MP_QSTR_index); + + mp_obj_t item = self->items[i]; + if (mp_obj_is_small_int(item)) { + common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(self->pixelbuf, MP_OBJ_SMALL_INT_VALUE(item), rgbw.r, rgbw.g, rgbw.b, rgbw.w); + } else { + size_t len; + mp_obj_t *items; + mp_obj_tuple_get(item, &len, &items); + + for (size_t j = 0; j < len; j++) { + common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(self->pixelbuf, MP_OBJ_SMALL_INT_VALUE(items[j]), rgbw.r, rgbw.g, rgbw.b, rgbw.w); + } + } +} + +static void pixelmap_set_pixel(pixelmap_pixelmap_obj_t *self, size_t i, mp_obj_t color) { + color_u rgbw; + common_hal_adafruit_pixelbuf_pixelbuf_parse_color(self->pixelbuf, color, &rgbw.r, &rgbw.g, &rgbw.b, &rgbw.w); + pixelmap_set_pixel_rgbw(self, i, rgbw); +} + +void shared_module_pixelmap_pixelmap_construct(pixelmap_pixelmap_obj_t *self, mp_obj_t pixelbuf, mp_obj_t indices) { + self->pixelbuf = pixelbuf; + self->indices = indices; + mp_obj_tuple_get(indices, &self->len, &self->items); +} + +static bool auto_write_get_and_clear(pixelmap_pixelmap_obj_t *self) { + bool auto_write = self->auto_write && common_hal_adafruit_pixelbuf_pixelbuf_get_auto_write(self->pixelbuf); + if (auto_write) { + common_hal_adafruit_pixelbuf_pixelbuf_set_auto_write(self->pixelbuf, false); + } + return auto_write; +} + +static void auto_write_reapply(pixelmap_pixelmap_obj_t *self, bool auto_write) { + if (auto_write) { + common_hal_adafruit_pixelbuf_pixelbuf_set_auto_write(self->pixelbuf, true); + common_hal_adafruit_pixelbuf_pixelbuf_show(self->pixelbuf); + } +} + +bool shared_module_pixelmap_pixelmap_auto_write_get(pixelmap_pixelmap_obj_t *self) { + return self->auto_write; +} + +void shared_module_pixelmap_pixelmap_auto_write_set(pixelmap_pixelmap_obj_t *self, bool auto_write) { + self->auto_write = auto_write; +} + +void shared_module_pixelmap_pixelmap_fill(pixelmap_pixelmap_obj_t *self, const mp_obj_t color) { + color_u rgbw; + common_hal_adafruit_pixelbuf_pixelbuf_parse_color(self->pixelbuf, color, &rgbw.r, &rgbw.g, &rgbw.b, &rgbw.w); + bool auto_write = auto_write_get_and_clear(self); + + for (size_t i = 0; i < self->len; i++) { + pixelmap_set_pixel_rgbw(self, i, rgbw); + } + + auto_write_reapply(self, auto_write); +} + +mp_obj_t shared_module_pixelmap_pixelmap_indices(pixelmap_pixelmap_obj_t *self, int index) { + mp_arg_validate_index_range(index, 0, self->len - 1, MP_QSTR_index); + + mp_obj_t item = self->items[index]; + if (mp_obj_is_small_int(item)) { + return mp_obj_new_tuple(1, &item); + } else { + return item; + } +} + +#if MICROPY_PY_BUILTINS_SLICE +void shared_module_pixelmap_pixelmap_setslice(pixelmap_pixelmap_obj_t *self, const mp_obj_t slice_in, const mp_obj_t values) { + mp_bound_slice_t slice; + mp_seq_get_fast_slice_indexes(self->len, slice_in, &slice); + size_t slice_len; + if (slice.step > 0) { + slice_len = slice.stop - slice.start; + } else { + slice_len = 1 + slice.start - slice.stop; + } + if (slice.step > 1 || slice.step < -1) { + size_t step = slice.step > 0 ? slice.step : slice.step * -1; + slice_len = (slice_len / step) + (slice_len % step ? 1 : 0); + } + + size_t num_items = mp_obj_get_int(mp_obj_len(values)); + if (num_items != slice_len) { + mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d, got %d)."), slice_len, num_items); + } + + bool auto_write = auto_write_get_and_clear(self); + + // because we didn't preflight the pixel values, an exception could occur. + // In that case we need to do the auto-write of any pixels that were set + // before re-raising the exception + nlr_buf_t nlr; + + size_t start = slice.start; + mp_int_t step = slice.step; + + if (nlr_push(&nlr) == 0) { + mp_obj_iter_buf_t iter_buf; + mp_obj_t iterable = mp_getiter(values, &iter_buf); + mp_obj_t item; + while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { + pixelmap_set_pixel(self, start, item); + start += step; + } + nlr_pop(); + auto_write_reapply(self, auto_write); + } else { + auto_write_reapply(self, auto_write); + // exception converting color value, re-raise + nlr_raise(MP_OBJ_FROM_PTR(nlr.ret_val)); + } +} +#endif + +void shared_module_pixelmap_pixelmap_setitem(pixelmap_pixelmap_obj_t *self, mp_int_t i, mp_obj_t color) { + color_u rgbw; + common_hal_adafruit_pixelbuf_pixelbuf_parse_color(self->pixelbuf, color, &rgbw.r, &rgbw.g, &rgbw.b, &rgbw.w); + bool auto_write = auto_write_get_and_clear(self); + pixelmap_set_pixel_rgbw(self, i, rgbw); + auto_write_reapply(self, auto_write); +} + +mp_obj_t shared_module_pixelmap_pixelmap_getitem(pixelmap_pixelmap_obj_t *self, mp_int_t i) { + mp_arg_validate_index_range(i, 0, self->len, MP_QSTR_index); + mp_obj_t item = self->items[i]; + if (mp_obj_is_small_int(item)) { + return common_hal_adafruit_pixelbuf_pixelbuf_get_pixel(self->pixelbuf, MP_OBJ_SMALL_INT_VALUE(item)); + } else { + size_t len; + mp_obj_t *items; + mp_obj_tuple_get(item, &len, &items); + return common_hal_adafruit_pixelbuf_pixelbuf_get_pixel(self->pixelbuf, MP_OBJ_SMALL_INT_VALUE(items[0])); + } +} diff --git a/shared-module/adafruit_pixelmap/PixelMap.h b/shared-module/adafruit_pixelmap/PixelMap.h new file mode 100644 index 0000000000..192d6a4f9c --- /dev/null +++ b/shared-module/adafruit_pixelmap/PixelMap.h @@ -0,0 +1,39 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Rose Hooper + * Copyright (c) 2022 Jeff Epler 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. + */ + +#pragma once + +#include "shared-module/adafruit_pixelbuf/PixelBuf.h" + +typedef struct _pixelmap_pixelmap_obj { + mp_obj_base_t base; + mp_obj_t pixelbuf; + mp_obj_t indices; + size_t len; + mp_obj_t *items; + bool auto_write; +} pixelmap_pixelmap_obj_t; diff --git a/shared-module/adafruit_pixelmap/__init__.c b/shared-module/adafruit_pixelmap/__init__.c new file mode 100644 index 0000000000..e69de29bb2 From 5d3484f61a051d1088e52b76db67afb4db7496b6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 11 Nov 2022 08:57:06 -0600 Subject: [PATCH 075/357] Update frozen modules --- frozen/Adafruit_CircuitPython_LIS3DH | 2 +- frozen/Adafruit_CircuitPython_Requests | 2 +- frozen/Adafruit_CircuitPython_SSD1680 | 2 +- frozen/Adafruit_CircuitPython_UC8151D | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_LIS3DH b/frozen/Adafruit_CircuitPython_LIS3DH index 18eaddb96a..5b4703428f 160000 --- a/frozen/Adafruit_CircuitPython_LIS3DH +++ b/frozen/Adafruit_CircuitPython_LIS3DH @@ -1 +1 @@ -Subproject commit 18eaddb96aa6599901ef2ff0e140e89a2de8c5d0 +Subproject commit 5b4703428fc299ac268d08350c885122b2af1e75 diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index a5d56f3e48..317f4bdb79 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit a5d56f3e4866c8dbb343e03500355a42c46e557a +Subproject commit 317f4bdb799afa59b164def4ea0610f57db9922e diff --git a/frozen/Adafruit_CircuitPython_SSD1680 b/frozen/Adafruit_CircuitPython_SSD1680 index adff47d7be..168624262c 160000 --- a/frozen/Adafruit_CircuitPython_SSD1680 +++ b/frozen/Adafruit_CircuitPython_SSD1680 @@ -1 +1 @@ -Subproject commit adff47d7be2a430b20e5ebcc59cb4e5a38fc171c +Subproject commit 168624262c18f5ee80ec392c0844d6a4c6548760 diff --git a/frozen/Adafruit_CircuitPython_UC8151D b/frozen/Adafruit_CircuitPython_UC8151D index a64fad692c..565fed5151 160000 --- a/frozen/Adafruit_CircuitPython_UC8151D +++ b/frozen/Adafruit_CircuitPython_UC8151D @@ -1 +1 @@ -Subproject commit a64fad692cc83fa1ac48b8f5ab1a955fd9b39251 +Subproject commit 565fed515138f962c4bcce0ee756d32e708a151a From d5ea4d8f2f775597962b6dfc08b466c58a9e9f45 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 10 Nov 2022 18:40:57 +0000 Subject: [PATCH 076/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (995 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f59efab8c2..c3f7475167 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-11-09 10:48+0000\n" +"PO-Revision-Date: 2022-11-11 18:49+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -3804,11 +3804,11 @@ msgstr "apenas bit_depth = 16 é compatível" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only mono is supported" -msgstr "" +msgstr "Apenas o mono é compatível" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only oversample=64 is supported" -msgstr "" +msgstr "apenas oversample=64 é compatível" #: ports/nrf/common-hal/audiobusio/PDMIn.c #: ports/stm/common-hal/audiobusio/PDMIn.c From b9ce2867a05efdcb357ffd1f45cd263eeca0eff1 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 10 Nov 2022 08:36:07 +0000 Subject: [PATCH 077/357] Translated using Weblate (Swedish) Currently translated at 100.0% (995 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 9b4332e60b..1980477f4f 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-11-09 10:48+0000\n" +"PO-Revision-Date: 2022-11-11 18:49+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -3769,11 +3769,11 @@ msgstr "bara bit_depth=16 stöds" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only mono is supported" -msgstr "" +msgstr "endast mono stöds" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only oversample=64 is supported" -msgstr "" +msgstr "endast oversample=64 stöds" #: ports/nrf/common-hal/audiobusio/PDMIn.c #: ports/stm/common-hal/audiobusio/PDMIn.c From 983502d6e3fe7611130ebec8d9f0d8d87fdbfb93 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 11 Nov 2022 15:31:49 -0500 Subject: [PATCH 078/357] ignore pin changes before sleep --- ports/raspberrypi/common-hal/alarm/__init__.c | 3 +++ .../common-hal/alarm/pin/PinAlarm.c | 27 +++++++++++-------- .../common-hal/alarm/pin/PinAlarm.h | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ports/raspberrypi/common-hal/alarm/__init__.c b/ports/raspberrypi/common-hal/alarm/__init__.c index 656d15af5a..f6d36f702e 100644 --- a/ports/raspberrypi/common-hal/alarm/__init__.c +++ b/ports/raspberrypi/common-hal/alarm/__init__.c @@ -234,6 +234,9 @@ void NORETURN common_hal_alarm_enter_deep_sleep(void) { // Reset uses the watchdog. Use scratch registers to store wake reason watchdog_hw->scratch[RP_WKUP_SCRATCH_REG] = _get_wakeup_cause(); + + // Just before reset, enable the pinalarm interrupt. + alarm_pin_pinalarm_entering_deep_sleep(); reset_cpu(); } diff --git a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c index 0af27cb44f..93b8ff3165 100644 --- a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c +++ b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c @@ -38,7 +38,7 @@ STATIC bool woke_up; STATIC uint64_t alarm_triggered_pins; // 36 actual pins STATIC uint64_t alarm_reserved_pins; // 36 actual pins -STATIC bool _pinalarm_set = false; +STATIC bool _not_yet_deep_sleeping = false; #define GPIO_IRQ_ALL_EVENTS 0x15u @@ -46,12 +46,21 @@ STATIC void gpio_callback(uint gpio, uint32_t events) { alarm_triggered_pins |= (1 << gpio); woke_up = true; - // does this need to be called, to prevent IRQ from constantly going off? - gpio_acknowledge_irq(gpio, events); + // gpio_acknowledge_irq(gpio, events) is called automatically, before this callback is called. - // Disable IRQ automatically - gpio_set_irq_enabled(gpio, events, false); - gpio_set_dormant_irq_enabled(gpio, events, false); + if (_not_yet_deep_sleeping) { + // Event went off prematurely, before we went to sleep, so set it again. + gpio_set_irq_enabled(gpio, events, false); + } else { + // Went off during sleep. + // Disable IRQ automatically. + gpio_set_irq_enabled(gpio, events, false); + gpio_set_dormant_irq_enabled(gpio, events, false); + } +} + +void alarm_pin_pinalarm_entering_deep_sleep() { + _not_yet_deep_sleeping = false; } void common_hal_alarm_pin_pinalarm_construct(alarm_pin_pinalarm_obj_t *self, const mcu_pin_obj_t *pin, bool value, bool edge, bool pull) { @@ -156,11 +165,7 @@ void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ob gpio_set_dormant_irq_enabled((uint)alarm->pin->number, event, true); } - _pinalarm_set = true; + _not_yet_deep_sleeping = true; } } } - -bool alarm_pin_pinalarm_is_set(void) { - return _pinalarm_set; -} diff --git a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h index 9dcbf2b848..26c6c49a5e 100644 --- a/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h +++ b/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.h @@ -46,4 +46,4 @@ void alarm_pin_pinalarm_reset(void); void alarm_pin_pinalarm_light_reset(void); void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms); bool alarm_pin_pinalarm_woke_this_cycle(void); -bool alarm_pin_pinalarm_is_set(void); +void alarm_pin_pinalarm_entering_deep_sleep(void); From b544a3920a2006330f32f0c04e4fc51113295632 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 11 Nov 2022 14:44:13 -0600 Subject: [PATCH 079/357] update ulab to 6.0.1 --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 57de23c1fb..25a825e41c 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 57de23c1fb434ba99aaafe1d00bd77d5cdf5d66b +Subproject commit 25a825e41c26cfcee018b762416741d0d63aeabf From 3c4d8c692690e33ec8a29c68ee143a780b418b2a Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 11 Nov 2022 17:50:07 -0600 Subject: [PATCH 080/357] implement self hidden property for vectorio shapes --- shared-bindings/vectorio/Circle.c | 4 ++++ shared-bindings/vectorio/Polygon.c | 4 ++++ shared-bindings/vectorio/Rectangle.c | 4 ++++ shared-bindings/vectorio/VectorShape.c | 27 ++++++++++++++++++++++++++ shared-bindings/vectorio/VectorShape.h | 4 ++++ shared-module/vectorio/VectorShape.c | 15 ++++++++++++++ shared-module/vectorio/VectorShape.h | 1 + 7 files changed, 59 insertions(+) diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 91b0d3ae34..65428966ce 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -109,6 +109,9 @@ MP_PROPERTY_GETSET(vectorio_circle_color_index_obj, //| y: int //| """Y position of the center point of the circle in the parent.""" //| +//| hidden: boolean +//| """Hide the circle or not.""" +//| //| location: Tuple[int, int] //| """(X,Y) position of the center point of the circle in the parent.""" //| @@ -123,6 +126,7 @@ STATIC const mp_rom_map_elem_t vectorio_circle_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_radius), MP_ROM_PTR(&vectorio_circle_radius_obj) }, { MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&vectorio_vector_shape_x_obj) }, { MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&vectorio_vector_shape_y_obj) }, + { MP_ROM_QSTR(MP_QSTR_hidden), MP_ROM_PTR(&vectorio_vector_shape_hidden_obj) }, { MP_ROM_QSTR(MP_QSTR_color_index), MP_ROM_PTR(&vectorio_circle_color_index_obj) }, { MP_ROM_QSTR(MP_QSTR_location), MP_ROM_PTR(&vectorio_vector_shape_location_obj) }, { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&vectorio_vector_shape_pixel_shader_obj) }, diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index f4f07c66a0..c3a6b3f31b 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -118,6 +118,9 @@ MP_PROPERTY_GETSET(vectorio_polygon_color_index_obj, //| y: int //| """Y position of the 0,0 origin in the points list.""" //| +//| hidden: boolean +//| """Hide the polygon or not.""" +//| //| location: Tuple[int, int] //| """(X,Y) position of the 0,0 origin in the points list.""" //| @@ -132,6 +135,7 @@ STATIC const mp_rom_map_elem_t vectorio_polygon_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_points), MP_ROM_PTR(&vectorio_polygon_points_obj) }, { MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&vectorio_vector_shape_x_obj) }, { MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&vectorio_vector_shape_y_obj) }, + { MP_ROM_QSTR(MP_QSTR_hidden), MP_ROM_PTR(&vectorio_vector_shape_hidden_obj) }, { MP_ROM_QSTR(MP_QSTR_color_index), MP_ROM_PTR(&vectorio_polygon_color_index_obj) }, { MP_ROM_QSTR(MP_QSTR_location), MP_ROM_PTR(&vectorio_vector_shape_location_obj) }, { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&vectorio_vector_shape_pixel_shader_obj) }, diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c index 5c163a7693..8f6c9ffd28 100644 --- a/shared-bindings/vectorio/Rectangle.c +++ b/shared-bindings/vectorio/Rectangle.c @@ -139,6 +139,9 @@ const mp_obj_property_t vectorio_rectangle_color_index_obj = { //| y: int //| """Y position of the top left corner of the rectangle in the parent.""" //| +//| hidden: boolean +//| """Hide the rectangle or not.""" +//| //| location: Tuple[int, int] //| """(X,Y) position of the top left corner of the rectangle in the parent.""" //| @@ -152,6 +155,7 @@ STATIC const mp_rom_map_elem_t vectorio_rectangle_locals_dict_table[] = { // Properties { MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&vectorio_vector_shape_x_obj) }, { MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&vectorio_vector_shape_y_obj) }, + { MP_ROM_QSTR(MP_QSTR_hidden), MP_ROM_PTR(&vectorio_vector_shape_hidden_obj) }, { MP_ROM_QSTR(MP_QSTR_color_index), MP_ROM_PTR(&vectorio_rectangle_color_index_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&vectorio_rectangle_width_obj) }, { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&vectorio_rectangle_height_obj) }, diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index ba55cfb851..e5c806b943 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -181,6 +181,33 @@ MP_PROPERTY_GETSET(vectorio_vector_shape_location_obj, (mp_obj_t)&vectorio_vector_shape_set_location_obj); +// Stub checker does not approve of these shared properties. +// hidden: bool +// """Hide the shape or not.""" +// +STATIC mp_obj_t vectorio_vector_shape_obj_get_hidden(mp_obj_t wrapper_shape) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); + return mp_obj_new_bool(common_hal_vectorio_vector_shape_get_hidden(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_hidden_obj, vectorio_vector_shape_obj_get_hidden); + +STATIC mp_obj_t vectorio_vector_shape_obj_set_hidden(mp_obj_t wrapper_shape, mp_obj_t hidden_obj) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); + + common_hal_vectorio_vector_shape_set_hidden(self, mp_obj_is_true(hidden_obj)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(vectorio_vector_shape_set_hidden_obj, vectorio_vector_shape_obj_set_hidden); + +MP_PROPERTY_GETSET(vectorio_vector_shape_hidden_obj, + (mp_obj_t)&vectorio_vector_shape_get_hidden_obj, + (mp_obj_t)&vectorio_vector_shape_set_hidden_obj); + + // pixel_shader: Union[ColorConverter, Palette] // """The pixel shader of the shape.""" // diff --git a/shared-bindings/vectorio/VectorShape.h b/shared-bindings/vectorio/VectorShape.h index 13f62922f3..c94476c25a 100644 --- a/shared-bindings/vectorio/VectorShape.h +++ b/shared-bindings/vectorio/VectorShape.h @@ -31,6 +31,9 @@ void common_hal_vectorio_vector_shape_set_location(vectorio_vector_shape_t *self mp_int_t common_hal_vectorio_vector_shape_get_y(vectorio_vector_shape_t *self); void common_hal_vectorio_vector_shape_set_y(vectorio_vector_shape_t *self, mp_int_t y); +mp_int_t common_hal_vectorio_vector_shape_get_hidden(vectorio_vector_shape_t *self); +void common_hal_vectorio_vector_shape_set_hidden(vectorio_vector_shape_t *self, bool hidden); + mp_obj_t common_hal_vectorio_vector_shape_get_pixel_shader(vectorio_vector_shape_t *self); void common_hal_vectorio_vector_shape_set_pixel_shader(vectorio_vector_shape_t *self, mp_obj_t pixel_shader); @@ -40,6 +43,7 @@ void vectorio_vector_shape_update_transform(vectorio_vector_shape_t *self, displ extern vectorio_draw_protocol_impl_t vectorio_vector_shape_draw_protocol_impl; extern const mp_obj_property_getset_t vectorio_vector_shape_x_obj; extern const mp_obj_property_getset_t vectorio_vector_shape_y_obj; +extern const mp_obj_property_getset_t vectorio_vector_shape_hidden_obj; extern const mp_obj_property_getset_t vectorio_vector_shape_location_obj; extern const mp_obj_property_getset_t vectorio_vector_shape_pixel_shader_obj; extern const mp_obj_fun_builtin_fixed_t vectorio_vector_shape_contains_obj; diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index d9c13f54cc..20e1405d9a 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -293,6 +293,16 @@ void common_hal_vectorio_vector_shape_set_location(vectorio_vector_shape_t *self } } +mp_int_t common_hal_vectorio_vector_shape_get_hidden(vectorio_vector_shape_t *self) { + VECTORIO_SHAPE_DEBUG("%p get_hidden\n", self); + return self->hidden; +} + +void common_hal_vectorio_vector_shape_set_hidden(vectorio_vector_shape_t *self, bool hidden) { + VECTORIO_SHAPE_DEBUG("%p set_hidden %d\n", self, x); + self->hidden = hidden; + common_hal_vectorio_vector_shape_set_dirty(self); +} mp_obj_t common_hal_vectorio_vector_shape_get_pixel_shader(vectorio_vector_shape_t *self) { VECTORIO_SHAPE_DEBUG("%p get_pixel_shader\n", self); @@ -315,6 +325,11 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ uint64_t start = common_hal_time_monotonic_ns(); uint64_t pixel_time = 0; #endif + + if (self->hidden) { + return false; + } + VECTORIO_SHAPE_DEBUG("%p fill_area: fill: {(%5d,%5d), (%5d,%5d)}", self, area->x1, area->y1, area->x2, area->y2 diff --git a/shared-module/vectorio/VectorShape.h b/shared-module/vectorio/VectorShape.h index fdbae964a8..ce5823e40c 100644 --- a/shared-module/vectorio/VectorShape.h +++ b/shared-module/vectorio/VectorShape.h @@ -30,6 +30,7 @@ typedef struct { mp_obj_t pixel_shader; int16_t x; int16_t y; + bool hidden : 1; displayio_buffer_transform_t *absolute_transform; // Tracks current shape footprint and expands outward as the shape dirties and changes. // This is suboptimal if you move your shape far. Could add more state to only redraw From 56be5477542b31313d01731cd9730932b4eec66d Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 11 Nov 2022 20:18:42 -0600 Subject: [PATCH 081/357] fix type name --- shared-bindings/vectorio/Circle.c | 2 +- shared-bindings/vectorio/Polygon.c | 2 +- shared-bindings/vectorio/Rectangle.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 65428966ce..87cd46ad9a 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -109,7 +109,7 @@ MP_PROPERTY_GETSET(vectorio_circle_color_index_obj, //| y: int //| """Y position of the center point of the circle in the parent.""" //| -//| hidden: boolean +//| hidden: bool //| """Hide the circle or not.""" //| //| location: Tuple[int, int] diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index c3a6b3f31b..6ad102e6e6 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -118,7 +118,7 @@ MP_PROPERTY_GETSET(vectorio_polygon_color_index_obj, //| y: int //| """Y position of the 0,0 origin in the points list.""" //| -//| hidden: boolean +//| hidden: bool //| """Hide the polygon or not.""" //| //| location: Tuple[int, int] diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c index 8f6c9ffd28..a4f3e12e69 100644 --- a/shared-bindings/vectorio/Rectangle.c +++ b/shared-bindings/vectorio/Rectangle.c @@ -139,7 +139,7 @@ const mp_obj_property_t vectorio_rectangle_color_index_obj = { //| y: int //| """Y position of the top left corner of the rectangle in the parent.""" //| -//| hidden: boolean +//| hidden: bool //| """Hide the rectangle or not.""" //| //| location: Tuple[int, int] From 6c3b9b64dacf16f128d069bb90e2ce3169ca569c Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Nov 2022 03:22:15 +0000 Subject: [PATCH 082/357] add crcibernetica-ideaboard --- .../boards/crcibernetica-ideaboard/board.c | 29 +++++++++++ .../crcibernetica-ideaboard/mpconfigboard.h | 43 +++++++++++++++ .../crcibernetica-ideaboard/mpconfigboard.mk | 9 ++++ .../boards/crcibernetica-ideaboard/pins.c | 52 +++++++++++++++++++ 4 files changed, 133 insertions(+) create mode 100644 ports/espressif/boards/crcibernetica-ideaboard/board.c create mode 100644 ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.h create mode 100644 ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.mk create mode 100644 ports/espressif/boards/crcibernetica-ideaboard/pins.c diff --git a/ports/espressif/boards/crcibernetica-ideaboard/board.c b/ports/espressif/boards/crcibernetica-ideaboard/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/crcibernetica-ideaboard/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.h b/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.h new file mode 100644 index 0000000000..2d20fff211 --- /dev/null +++ b/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert 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 "CRCibernetica IdeaBoard" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO22, .sda = &pin_GPIO21}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO17, .rx = &pin_GPIO16}} + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.mk b/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.mk new file mode 100644 index 0000000000..cbc468b3ec --- /dev/null +++ b/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.mk @@ -0,0 +1,9 @@ +CIRCUITPY_CREATOR_ID = 0x0000303A +CIRCUITPY_CREATION_ID = 0x00320002 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/crcibernetica-ideaboard/pins.c b/ports/espressif/boards/crcibernetica-ideaboard/pins.c new file mode 100644 index 0000000000..8f90bc90a0 --- /dev/null +++ b/ports/espressif/boards/crcibernetica-ideaboard/pins.c @@ -0,0 +1,52 @@ +#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_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { 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_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_IO23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_IO25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_IO27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_IO32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 512cda8b73d795e17c863da167233e218b58d9b4 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sat, 12 Nov 2022 10:03:00 +0530 Subject: [PATCH 083/357] enable `microcontroller.cpu.temperature` on esp32s3 --- ports/espressif/common-hal/microcontroller/Processor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/common-hal/microcontroller/Processor.c b/ports/espressif/common-hal/microcontroller/Processor.c index 9b97b98cbd..bacc48c07b 100644 --- a/ports/espressif/common-hal/microcontroller/Processor.c +++ b/ports/espressif/common-hal/microcontroller/Processor.c @@ -40,13 +40,13 @@ #include "soc/efuse_reg.h" -#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S3) +#if !defined(CONFIG_IDF_TARGET_ESP32) #include "driver/temp_sensor.h" #endif float common_hal_mcu_processor_get_temperature(void) { float tsens_out; - #if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32) + #if defined(CONFIG_IDF_TARGET_ESP32) mp_raise_NotImplementedError(NULL); #else temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); // DEFAULT: range:-10℃ ~ 80℃, error < 1℃. From 78fc43baab6517a91426480eb2d6e9919f6a998a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Nov 2022 09:16:23 -0600 Subject: [PATCH 084/357] raspberrypi: Make port_idle_until_interrupt work This needs thorough testing before it's merged, as we tried and reverted this once before (#5341 and #5356). I think that besides checking for tinyusb having "something to do", the fact that `port_interrupt_after_ticks` and `port_disable_tick` weren't implemented that was causing a secondary problem. I've tested this on a pico w over reboot-cycles and ctrl-c-cycles, with and without drive automounting, with and without serial repl open, and on a power-only connection. I didn't notice the problem reported in #5356 after merely implementing port_idle_until_interrupt; but I did notice that sleeps in general would take over-long until "something" (like writing to the USB drive) happened; I think "something" was probably calling port_enable_tick(). When this problem was happening, sleeps would take a lot longer; for instance, `sleep(.001)` would take about 1/20s and `sleep(.1)` would take about 1/7s. --- ports/raspberrypi/Makefile | 1 + ports/raspberrypi/supervisor/port.c | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 5095c4c1f8..49a66c28aa 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -127,6 +127,7 @@ INC += \ -I../shared/timeutils \ -Iboards/$(BOARD) \ -Iboards/ \ + -isystem ./../../lib/cmsis/inc \ -isystem sdk/ \ -isystem sdk/src/common/pico_base/include/ \ -isystem sdk/src/common/pico_binary_info/include/ \ diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 781d2b11d2..89e451a3b0 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -72,6 +72,9 @@ #include "supervisor/serial.h" +#include "tusb.h" +#include + extern volatile bool mp_msc_enabled; STATIC void _tick_callback(uint alarm_num); @@ -241,38 +244,48 @@ uint32_t port_get_saved_word(void) { return __scratch_x_start__; } +static volatile bool ticks_enabled; + uint64_t port_get_raw_ticks(uint8_t *subticks) { uint64_t microseconds = time_us_64(); return 1024 * (microseconds / 1000000) + (microseconds % 1000000) / 977; } STATIC void _tick_callback(uint alarm_num) { - supervisor_tick(); - hardware_alarm_set_target(0, delayed_by_us(get_absolute_time(), 977)); + if (ticks_enabled) { + supervisor_tick(); + hardware_alarm_set_target(0, delayed_by_us(get_absolute_time(), 977)); + } } // Enable 1/1024 second tick. void port_enable_tick(void) { + ticks_enabled = true; hardware_alarm_set_target(0, delayed_by_us(get_absolute_time(), 977)); } // Disable 1/1024 second tick. void port_disable_tick(void) { - // hardware_alarm_cancel(0); + // One additional _tick_callback may occur, but it will just return + // whenever !ticks_enabled. Cancel is not called just in case + // it could nuke a timeout set by port_interrupt_after_ticks. + ticks_enabled = false; } // This is called by sleep, we ignore it when our ticks are enabled because // they'll wake us up earlier. If we don't, we'll mess up ticks by overwriting // the next RTC wake up time. void port_interrupt_after_ticks(uint32_t ticks) { + if (!ticks_enabled) { + hardware_alarm_set_target(0, delayed_by_us(get_absolute_time(), ticks * 977)); + } } void port_idle_until_interrupt(void) { common_hal_mcu_disable_interrupts(); - if (!background_callback_pending()) { - // TODO: Does not work when board is power-cycled. - // asm volatile ("dsb 0xF" ::: "memory"); - // __wfi(); + if (!background_callback_pending() && !tud_task_event_ready()) { + __DSB(); + __WFI(); } common_hal_mcu_enable_interrupts(); } From e4d620f0556f76d1c55450e0a3fdc4837bae3851 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Nov 2022 09:17:47 -0600 Subject: [PATCH 085/357] make whitespace match --- ports/raspberrypi/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 49a66c28aa..cb4c80a23d 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -120,8 +120,8 @@ SRC_LWIP := endif INC += \ - -I. \ - -Ilwip_inc \ + -I. \ + -Ilwip_inc \ -I../.. \ -I../lib/mp-readline \ -I../shared/timeutils \ From 43566dec5b94f5bf8551611f2da7dee886e3bab1 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 13 Nov 2022 12:13:32 +0000 Subject: [PATCH 086/357] allow inclusion of board while blocking build files --- ports/espressif/.gitignore | 2 +- .../boards/crcibernetica-ideaboard/sdkconfig | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 ports/espressif/boards/crcibernetica-ideaboard/sdkconfig diff --git a/ports/espressif/.gitignore b/ports/espressif/.gitignore index 51c080bb7f..d5350e07f9 100644 --- a/ports/espressif/.gitignore +++ b/ports/espressif/.gitignore @@ -1,5 +1,5 @@ # idf.py menuconfig -sdkconfig* +./sdkconfig* # lock files for examples and components dependencies.lock diff --git a/ports/espressif/boards/crcibernetica-ideaboard/sdkconfig b/ports/espressif/boards/crcibernetica-ideaboard/sdkconfig new file mode 100644 index 0000000000..6c0168c829 --- /dev/null +++ b/ports/espressif/boards/crcibernetica-ideaboard/sdkconfig @@ -0,0 +1,20 @@ +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_SPIRAM_SUPPORT=n + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings From b8f5def9859f74430f39579718c579373e2406c5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 13 Nov 2022 09:26:16 -0600 Subject: [PATCH 087/357] return to using python 3.x for builds --- .github/workflows/build.yml | 2 +- .github/workflows/create_website_pr.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- ports/espressif/esp-idf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0dc47946b5..92e6600f56 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.x" - name: Get CP deps run: python tools/ci_fetch_deps.py test ${{ github.sha }} - name: CircuitPython version diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 1658fe092c..75de556c68 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.x" - name: Get CP deps run: python tools/ci_fetch_deps.py website ${{ github.sha }} - name: Install deps diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 556f89e63c..a23dcd1d11 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.x" - name: Install deps run: | sudo apt-get install -y gettext uncrustify diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index 716d8531d7..dbb2d88eb8 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit 716d8531d71b122975e2966a24ec7613b87eb7b0 +Subproject commit dbb2d88eb8a90a314d6f2e7b0af71925802c552e From dec802a73b726ef3cee60b4aef0c7dd79964b5b2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 13 Nov 2022 13:26:35 -0600 Subject: [PATCH 088/357] build docs when .github/workflows changes Closes: #7205 --- tools/ci_set_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index f22840fad7..2629942383 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -215,7 +215,7 @@ def set_docs_to_build(build_all): doc_match = build_all if not build_all: doc_pattern = re.compile( - r"^(?:docs|extmod/ulab|(?:(?:ports/\w+/bindings|shared-bindings)\S+\.c|conf\.py|tools/extract_pyi\.py|requirements-doc\.txt)$)|(?:-stubs|\.(?:md|MD|rst|RST))$" + r"^(?:.github/workflows/|docs|extmod/ulab|(?:(?:ports/\w+/bindings|shared-bindings)\S+\.c|conf\.py|tools/extract_pyi\.py|requirements-doc\.txt)$)|(?:-stubs|\.(?:md|MD|rst|RST))$" ) for p in changed_files: if doc_pattern.search(p): From b499275bb5af25f785b86d77e3981b4ed72893b4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 17 Oct 2022 09:08:17 -0500 Subject: [PATCH 089/357] Don't crash when assigning attributes of the GeneratorExit const singleton --- py/mpconfig.h | 10 ++++++++++ py/obj.h | 4 +++- py/objexcept.c | 4 +++- py/objgenerator.c | 19 +++++++++++++++++-- py/vm.c | 5 ++++- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/py/mpconfig.h b/py/mpconfig.h index 386a9765eb..9d68f4ce9d 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -773,6 +773,16 @@ typedef long long mp_longint_impl_t; #define MICROPY_WARNINGS (0) #endif +// Whether to support chained exceptions +#ifndef MICROPY_CPYTHON_EXCEPTION_CHAIN +#define MICROPY_CPYTHON_EXCEPTION_CHAIN (0) +#endif + +// Whether the statically allocated GeneratorExit exception may be const +#ifndef MICROPY_CONST_GENERATOREXIT_OBJ +#define MICROPY_CONST_GENERATOREXIT_OBJ (!MICROPY_CPYTHON_EXCEPTION_CHAIN) +#endif + // Whether to support warning categories #ifndef MICROPY_WARNINGS_CATEGORY #define MICROPY_WARNINGS_CATEGORY (0) diff --git a/py/obj.h b/py/obj.h index 7fa21f5e38..b7e76a1106 100644 --- a/py/obj.h +++ b/py/obj.h @@ -791,7 +791,9 @@ extern const struct _mp_obj_dict_t mp_const_empty_dict_obj; extern const struct _mp_obj_traceback_t mp_const_empty_traceback_obj; extern const struct _mp_obj_singleton_t mp_const_ellipsis_obj; extern const struct _mp_obj_singleton_t mp_const_notimplemented_obj; -extern const struct _mp_obj_exception_t mp_const_GeneratorExit_obj; +#if MICROPY_CONST_GENERATOREXIT_OBJ +extern const struct _mp_obj_exception_t mp_static_GeneratorExit_obj; +#endif // Fixed empty map. Useful when calling keyword-receiving functions // without any keywords from C, etc. diff --git a/py/objexcept.c b/py/objexcept.c index 32dacbb17a..5491aea3bf 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -218,9 +218,11 @@ void mp_obj_exception_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { mp_obj_exception_t *self = MP_OBJ_TO_PTR(self_in); if (dest[0] != MP_OBJ_NULL) { // store/delete attribute - if (self == &mp_const_GeneratorExit_obj) { + #if MICROPY_CONST_GENERATOREXIT_OBJ + if (self == &mp_static_GeneratorExit_obj) { mp_raise_AttributeError(MP_ERROR_TEXT("can't set attribute")); } + #endif if (attr == MP_QSTR___traceback__) { if (dest[1] == mp_const_none) { self->traceback = (mp_obj_traceback_t *)&mp_const_empty_traceback_obj; diff --git a/py/objgenerator.c b/py/objgenerator.c index c9af11fbb5..2256911e23 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -38,7 +38,12 @@ #include "supervisor/shared/translate/translate.h" // Instance of GeneratorExit exception - needed by generator.close() -const mp_obj_exception_t mp_const_GeneratorExit_obj = {{&mp_type_GeneratorExit}, (mp_obj_tuple_t *)&mp_const_empty_tuple_obj, (mp_obj_traceback_t *)&mp_const_empty_traceback_obj}; +#if MICROPY_CONST_GENERATOREXIT_OBJ +const +#else +static +#endif +mp_obj_exception_t mp_static_GeneratorExit_obj = {{&mp_type_GeneratorExit}, (mp_obj_tuple_t *)&mp_const_empty_tuple_obj, (mp_obj_traceback_t *)&mp_const_empty_traceback_obj}; /******************************************************************************/ /* generator wrapper */ @@ -362,9 +367,19 @@ STATIC mp_obj_t gen_instance_throw(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gen_instance_throw_obj, 2, 4, gen_instance_throw); +static mp_obj_t generatorexit(void) { + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + MP_STATIC_ASSERT(!MICROPY_CONST_GENERATOREXIT_OBJ); + mp_static_GeneratorExit_obj.context = NULL; + mp_static_GeneratorExit_obj.cause = NULL; + mp_static_GeneratorExit_obj.suppress_context = false; + #endif + return MP_OBJ_FROM_PTR(&mp_static_GeneratorExit_obj); +} + STATIC mp_obj_t gen_instance_close(mp_obj_t self_in) { mp_obj_t ret; - switch (mp_obj_gen_resume(self_in, mp_const_none, MP_OBJ_FROM_PTR(&mp_const_GeneratorExit_obj), &ret)) { + switch (mp_obj_gen_resume(self_in, mp_const_none, generatorexit(), &ret)) { case MP_VM_RETURN_YIELD: mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("generator ignored GeneratorExit")); diff --git a/py/vm.c b/py/vm.c index 12a0f2d445..04e08e9fd1 100644 --- a/py/vm.c +++ b/py/vm.c @@ -1391,7 +1391,10 @@ unwind_loop: // - constant GeneratorExit object, because it's const // - exceptions re-raised by END_FINALLY // - exceptions re-raised explicitly by "raise" - if (nlr.ret_val != &mp_const_GeneratorExit_obj + if ( true + #if MICROPY_CONST_GENERATOREXIT_OBJ + && nlr.ret_val != &mp_static_GeneratorExit_obj + #endif && *code_state->ip != MP_BC_END_FINALLY && *code_state->ip != MP_BC_RAISE_LAST) { const byte *ip = code_state->fun_bc->bytecode; From f3169246ba0ec367bf2b1732351ba365c6819800 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 16 Oct 2022 15:58:44 -0500 Subject: [PATCH 090/357] Implement chained exceptions This adds the __cause__, __context__ and __suppress_context__ members to exception objects and makes e.g., `raise exc from cause` set them in the same way as standard Python. --- .../unix/variants/coverage/mpconfigvariant.h | 1 + py/circuitpy_mpconfig.h | 3 ++ py/objexcept.c | 34 ++++++++++++- py/objexcept.h | 2 + py/vm.c | 37 ++++++++++---- tests/basics/exception_chain.py | 50 +++++++++++++++++-- tests/basics/exception_chain.py.exp | 2 - tests/run-tests.py | 8 ++- 8 files changed, 118 insertions(+), 19 deletions(-) delete mode 100644 tests/basics/exception_chain.py.exp diff --git a/ports/unix/variants/coverage/mpconfigvariant.h b/ports/unix/variants/coverage/mpconfigvariant.h index f6ebc2087b..ba9e941c28 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.h +++ b/ports/unix/variants/coverage/mpconfigvariant.h @@ -65,6 +65,7 @@ #define MICROPY_PY_UCRYPTOLIB (1) #define MICROPY_PY_UCRYPTOLIB_CTR (1) #define MICROPY_PY_MICROPYTHON_HEAP_LOCKED (1) +#define MICROPY_CPYTHON_EXCEPTION_CHAIN (1) // use vfs's functions for import stat and builtin open #define mp_import_stat mp_vfs_import_stat diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 6ae8275058..d6d8419c8f 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -224,6 +224,9 @@ typedef long mp_off_t; #ifndef MICROPY_CPYTHON_COMPAT #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) #endif +#ifndef MICROPY_CPYTHON_EXCEPTION_CHAIN +#define MICROPY_CPYTHON_EXCEPTION_CHAIN (CIRCUITPY_FULL_BUILD) +#endif #define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_BUILTINS_POW3) #define MICROPY_PY_FSTRINGS (1) #define MICROPY_MODULE_WEAK_LINKS (0) diff --git a/py/objexcept.c b/py/objexcept.c index 5491aea3bf..80da487076 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -228,11 +228,35 @@ void mp_obj_exception_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { self->traceback = (mp_obj_traceback_t *)&mp_const_empty_traceback_obj; } else { if (!mp_obj_is_type(dest[1], &mp_type_traceback)) { - mp_raise_TypeError(MP_ERROR_TEXT("invalid traceback")); + mp_raise_TypeError_varg(MP_ERROR_TEXT("%q must be of type %q or None"), MP_QSTR___context__, MP_QSTR_traceback); } self->traceback = MP_OBJ_TO_PTR(dest[1]); } dest[0] = MP_OBJ_NULL; // indicate success + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + } else if (attr == MP_QSTR___cause__) { + if (dest[1] == mp_const_none) { + self->cause = NULL; + } else if (!mp_obj_is_type(dest[1], &mp_type_BaseException)) { + self->cause = dest[1]; + } else { + mp_raise_TypeError_varg(MP_ERROR_TEXT("%q must be of type %q or None"), attr, MP_QSTR_BaseException); + } + self->suppress_context = true; + dest[0] = MP_OBJ_NULL; // indicate success + } else if (attr == MP_QSTR___context__) { + if (dest[1] == mp_const_none) { + self->context = NULL; + } else if (!mp_obj_is_type(dest[1], &mp_type_BaseException)) { + self->context = dest[1]; + } else { + mp_raise_TypeError_varg(MP_ERROR_TEXT("%q must be of type %q or None"), attr, MP_QSTR_BaseException); + } + dest[0] = MP_OBJ_NULL; // indicate success + } else if (attr == MP_QSTR___suppress_context__) { + self->suppress_context = mp_obj_is_true(dest[1]); + dest[0] = MP_OBJ_NULL; // indicate success + #endif } return; } @@ -242,6 +266,14 @@ void mp_obj_exception_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { dest[0] = mp_obj_exception_get_value(self_in); } else if (attr == MP_QSTR___traceback__) { dest[0] = (self->traceback) ? MP_OBJ_FROM_PTR(self->traceback) : mp_const_none; + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + } else if (attr == MP_QSTR___cause__) { + dest[0] = (self->cause) ? MP_OBJ_FROM_PTR(self->cause) : mp_const_none; + } else if (attr == MP_QSTR___context__) { + dest[0] = (self->context) ? MP_OBJ_FROM_PTR(self->context) : mp_const_none; + } else if (attr == MP_QSTR___suppress_context__) { + dest[0] = mp_obj_new_bool(self->suppress_context); + #endif #if MICROPY_CPYTHON_COMPAT } else if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(self->base.type), MP_OBJ_FROM_PTR(&mp_type_OSError))) { if (attr == MP_QSTR_errno) { diff --git a/py/objexcept.h b/py/objexcept.h index f28f50f5dc..24eb5cf527 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -34,6 +34,8 @@ typedef struct _mp_obj_exception_t { mp_obj_base_t base; mp_obj_tuple_t *args; mp_obj_traceback_t *traceback; + mp_obj_t cause, context; + bool suppress_context; } mp_obj_exception_t; void mp_obj_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); diff --git a/py/vm.c b/py/vm.c index 04e08e9fd1..6d9b7f7a0b 100644 --- a/py/vm.c +++ b/py/vm.c @@ -183,6 +183,15 @@ #define TRACE_TICK(current_ip, current_sp, is_exception) #endif // MICROPY_PY_SYS_SETTRACE +STATIC mp_obj_t get_active_exception(mp_exc_stack_t *exc_sp, mp_exc_stack_t *exc_stack) { + for (mp_exc_stack_t *e = exc_sp; e >= exc_stack; --e) { + if (e->prev_exc != NULL) { + return MP_OBJ_FROM_PTR(e->prev_exc); + } + } + return MP_OBJ_NULL; +} + // fastn has items in reverse order (fastn[0] is local[0], fastn[-1] is local[1], etc) // sp points to bottom of stack which grows up // returns: @@ -1129,13 +1138,7 @@ unwind_return: ENTRY(MP_BC_RAISE_LAST): { MARK_EXC_IP_SELECTIVE(); // search for the inner-most previous exception, to reraise it - mp_obj_t obj = MP_OBJ_NULL; - for (mp_exc_stack_t *e = exc_sp; e >= exc_stack; --e) { - if (e->prev_exc != NULL) { - obj = MP_OBJ_FROM_PTR(e->prev_exc); - break; - } - } + mp_obj_t obj = get_active_exception(exc_sp, exc_stack); if (obj == MP_OBJ_NULL) { obj = mp_obj_new_exception_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("no active exception to reraise")); } @@ -1145,14 +1148,30 @@ unwind_return: ENTRY(MP_BC_RAISE_OBJ): { MARK_EXC_IP_SELECTIVE(); mp_obj_t obj = mp_make_raise_obj(TOP()); + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + mp_obj_t active_exception = get_active_exception(exc_sp, exc_stack); + if (active_exception != MP_OBJ_NULL) { + mp_store_attr(obj, MP_QSTR___context__, active_exception); + } + #endif RAISE(obj); } ENTRY(MP_BC_RAISE_FROM): { MARK_EXC_IP_SELECTIVE(); - mp_warning(NULL, "exception chaining not supported"); - sp--; // ignore (pop) "from" argument + mp_obj_t cause = POP(); mp_obj_t obj = mp_make_raise_obj(TOP()); + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + // search for the inner-most previous exception, to chain it + mp_obj_t active_exception = get_active_exception(exc_sp, exc_stack); + if (active_exception != MP_OBJ_NULL) { + mp_store_attr(obj, MP_QSTR___context__, active_exception); + } + mp_store_attr(obj, MP_QSTR___cause__, cause); + #else + (void)cause; + mp_warning(NULL, "exception chaining not supported"); + #endif RAISE(obj); } diff --git a/tests/basics/exception_chain.py b/tests/basics/exception_chain.py index c3a7d6b113..ef506c7cb0 100644 --- a/tests/basics/exception_chain.py +++ b/tests/basics/exception_chain.py @@ -1,6 +1,46 @@ -# Exception chaining is not supported, but check that basic -# exception works as expected. try: - raise Exception from None -except Exception: - print("Caught Exception") + Exception().__cause__ +except AttributeError: + print("SKIP") + raise SystemExit + +def print_exc_info(e): + print("exception", type(e), repr(e)) + print("context", type(e.__context__), e.__suppress_context__) + print("cause", type(e.__cause__)) + +try: + try: + 1/0 + except Exception as inner: + raise RuntimeError() from inner +except Exception as e: + print_exc_info(e) +print() + +try: + try: + 1/0 + except Exception as inner: + raise RuntimeError() from OSError() +except Exception as e: + print_exc_info(e) +print() + + +try: + try: + 1/0 + except Exception as inner: + raise RuntimeError() +except Exception as e: + print_exc_info(e) +print() + +try: + try: + 1/0 + except Exception as inner: + raise RuntimeError() from None +except Exception as e: + print_exc_info(e) diff --git a/tests/basics/exception_chain.py.exp b/tests/basics/exception_chain.py.exp deleted file mode 100644 index 13635b3cde..0000000000 --- a/tests/basics/exception_chain.py.exp +++ /dev/null @@ -1,2 +0,0 @@ -Warning: exception chaining not supported -Caught Exception diff --git a/tests/run-tests.py b/tests/run-tests.py index ed0cf18e45..7a7b3adbcb 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -522,8 +522,12 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1): skip_tests.add("basics/scope_implicit.py") # requires checking for unbound local skip_tests.add("basics/try_finally_return2.py") # requires raise_varargs skip_tests.add("basics/unboundlocal.py") # requires checking for unbound local - skip_tests.add( - "circuitpython/traceback_test.py" + skip_tests.update( + ( + "basics/chained_exception.py", + "circuitpython/traceback_test.py", + "circuitpython/traceback_test_chained.py", + ) ) # because native doesn't have proper traceback info skip_tests.add("extmod/uasyncio_event.py") # unknown issue skip_tests.add("extmod/uasyncio_lock.py") # requires async with From b6f86e1e731c59dc64e6fee1269d15dd3ad84b06 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 16 Oct 2022 16:21:48 -0500 Subject: [PATCH 091/357] Recursively print chained exceptions --- locale/circuitpython.pot | 20 ++++--- py/obj.c | 24 ++++++++ py/objexcept.h | 5 +- tests/circuitpython/traceback_test_chained.py | 55 +++++++++++++++++++ .../traceback_test_chained.py.exp | 43 +++++++++++++++ 5 files changed, 138 insertions(+), 9 deletions(-) create mode 100644 tests/circuitpython/traceback_test_chained.py create mode 100644 tests/circuitpython/traceback_test_chained.py.exp diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 044900bd30..3fb6507174 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -106,7 +106,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -171,11 +171,11 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -894,6 +894,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "" @@ -2007,6 +2011,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3153,7 +3161,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3336,10 +3344,6 @@ msgstr "" msgid "invalid syntax for number" msgstr "" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" diff --git a/py/obj.c b/py/obj.c index af2f4c1b68..72a0647176 100644 --- a/py/obj.c +++ b/py/obj.c @@ -142,9 +142,33 @@ void mp_obj_print(mp_obj_t o_in, mp_print_kind_t kind) { mp_obj_print_helper(MP_PYTHON_PRINTER, o_in, kind); } +static void mp_obj_print_inner_exception(const mp_print_t *print, mp_obj_t self_in, mp_int_t limit) { + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + mp_obj_exception_t *self = mp_obj_exception_get_native(self_in); + const compressed_string_t *msg = MP_ERROR_TEXT("During handling of the above exception, another exception occurred:"); + mp_obj_exception_t *inner = NULL; + if (self->cause) { + msg = MP_ERROR_TEXT("The above exception was the direct cause of the following exception:"); + inner = self->cause; + } else if (!self->suppress_context) { + inner = self->context; + } + if (inner && !inner->marked) { + inner->marked = true; + mp_obj_print_exception_with_limit(print, MP_OBJ_FROM_PTR(inner), limit); + inner->marked = false; + mp_printf(print, "\n"); + mp_cprintf(print, msg); + mp_printf(print, "\n\n"); + } + #endif +} + // helper function to print an exception with traceback void mp_obj_print_exception_with_limit(const mp_print_t *print, mp_obj_t exc, mp_int_t limit) { if (mp_obj_is_exception_instance(exc) && stack_ok()) { + mp_obj_print_inner_exception(print, exc, limit); + size_t n, *values; mp_obj_exception_get_traceback(exc, &n, &values); if (n > 0) { diff --git a/py/objexcept.h b/py/objexcept.h index 24eb5cf527..77b338e951 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -34,8 +34,11 @@ typedef struct _mp_obj_exception_t { mp_obj_base_t base; mp_obj_tuple_t *args; mp_obj_traceback_t *traceback; - mp_obj_t cause, context; + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + struct _mp_obj_exception_t *cause, *context; bool suppress_context; + bool marked; + #endif } mp_obj_exception_t; void mp_obj_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); diff --git a/tests/circuitpython/traceback_test_chained.py b/tests/circuitpython/traceback_test_chained.py new file mode 100644 index 0000000000..a0acc876cc --- /dev/null +++ b/tests/circuitpython/traceback_test_chained.py @@ -0,0 +1,55 @@ +try: + Exception().__cause__ +except AttributeError: + print("SKIP") + raise SystemExit + +try: + import traceback +except: + print("SKIP") + raise SystemExit + + +def print_exc_info(e): + print("-" * 72) + traceback.print_exception(None, e, e.__traceback__) + print("-" * 72) + print() + + +try: + try: + 1 / 0 + except Exception as inner: + raise RuntimeError() from inner +except Exception as e: + print_exc_info(e) +print() + +try: + try: + 1 / 0 + except Exception as inner: + raise RuntimeError() from OSError() +except Exception as e: + print_exc_info(e) +print() + + +try: + try: + 1 / 0 + except Exception as inner: + raise RuntimeError() +except Exception as e: + print_exc_info(e) +print() + +try: + try: + 1 / 0 + except Exception as inner: + raise RuntimeError() from None +except Exception as e: + print_exc_info(e) diff --git a/tests/circuitpython/traceback_test_chained.py.exp b/tests/circuitpython/traceback_test_chained.py.exp new file mode 100644 index 0000000000..bc26c44a3e --- /dev/null +++ b/tests/circuitpython/traceback_test_chained.py.exp @@ -0,0 +1,43 @@ +------------------------------------------------------------------------ +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 23, in +ZeroDivisionError: division by zero + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 25, in +RuntimeError: +------------------------------------------------------------------------ + + +------------------------------------------------------------------------ +OSError: + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 34, in +RuntimeError: +------------------------------------------------------------------------ + + +------------------------------------------------------------------------ +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 42, in +ZeroDivisionError: division by zero + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 44, in +RuntimeError: +------------------------------------------------------------------------ + + +------------------------------------------------------------------------ +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 53, in +RuntimeError: +------------------------------------------------------------------------ + From dd443bacb857ae736bc51d81585e1063cd0a03f2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 17 Oct 2022 09:08:38 -0500 Subject: [PATCH 092/357] Chain exceptions while unwinding --- py/vm.c | 11 ++++++++++- tests/basics/exception_chain.py | 10 +++++++++- tests/circuitpython/traceback_test_chained.py | 8 ++++++++ tests/circuitpython/traceback_test_chained.py.exp | 12 ++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/py/vm.c b/py/vm.c index 6d9b7f7a0b..9e9dbcaa8d 100644 --- a/py/vm.c +++ b/py/vm.c @@ -1456,10 +1456,19 @@ unwind_loop: // catch exception and pass to byte code code_state->ip = exc_sp->handler; mp_obj_t *sp = MP_TAGPTR_PTR(exc_sp->val_sp); + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + mp_obj_t active_exception = get_active_exception(exc_sp, exc_stack); + #endif // save this exception in the stack so it can be used in a reraise, if needed exc_sp->prev_exc = nlr.ret_val; + mp_obj_t obj = MP_OBJ_FROM_PTR(nlr.ret_val); + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + if (active_exception != MP_OBJ_NULL) { + mp_store_attr(obj, MP_QSTR___context__, active_exception); + } + #endif // push exception object so it can be handled by bytecode - PUSH(MP_OBJ_FROM_PTR(nlr.ret_val)); + PUSH(obj); code_state->sp = sp; #if MICROPY_STACKLESS diff --git a/tests/basics/exception_chain.py b/tests/basics/exception_chain.py index ef506c7cb0..b84ff19dd6 100644 --- a/tests/basics/exception_chain.py +++ b/tests/basics/exception_chain.py @@ -5,7 +5,7 @@ except AttributeError: raise SystemExit def print_exc_info(e): - print("exception", type(e), repr(e)) + print("exception", type(e), e.args) print("context", type(e.__context__), e.__suppress_context__) print("cause", type(e.__cause__)) @@ -44,3 +44,11 @@ try: raise RuntimeError() from None except Exception as e: print_exc_info(e) + +try: + try: + raise RuntimeError() + except Exception as inner: + 1/0 +except Exception as e: + print_exc_info(e) diff --git a/tests/circuitpython/traceback_test_chained.py b/tests/circuitpython/traceback_test_chained.py index a0acc876cc..83d0c03466 100644 --- a/tests/circuitpython/traceback_test_chained.py +++ b/tests/circuitpython/traceback_test_chained.py @@ -53,3 +53,11 @@ try: raise RuntimeError() from None except Exception as e: print_exc_info(e) + +try: + try: + raise RuntimeError() + except Exception as inner: + 1 / 0 +except Exception as e: + print_exc_info(e) diff --git a/tests/circuitpython/traceback_test_chained.py.exp b/tests/circuitpython/traceback_test_chained.py.exp index bc26c44a3e..c874ff707f 100644 --- a/tests/circuitpython/traceback_test_chained.py.exp +++ b/tests/circuitpython/traceback_test_chained.py.exp @@ -41,3 +41,15 @@ Traceback (most recent call last): RuntimeError: ------------------------------------------------------------------------ +------------------------------------------------------------------------ +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 59, in +RuntimeError: + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 61, in +ZeroDivisionError: division by zero +------------------------------------------------------------------------ + From e1046b1050d21daab224b3044e8665fd5b6d859d Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Mon, 14 Nov 2022 14:04:07 +0000 Subject: [PATCH 093/357] Add support for the 16MB WeAct Studio Pico --- .../boards/weact_studio_pico_16mb/board.c | 29 ++++++++++ .../weact_studio_pico_16mb/mpconfigboard.h | 2 + .../weact_studio_pico_16mb/mpconfigboard.mk | 11 ++++ .../pico-sdk-configboard.h | 1 + .../boards/weact_studio_pico_16mb/pins.c | 53 +++++++++++++++++++ 5 files changed, 96 insertions(+) create mode 100644 ports/raspberrypi/boards/weact_studio_pico_16mb/board.c create mode 100644 ports/raspberrypi/boards/weact_studio_pico_16mb/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/weact_studio_pico_16mb/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/weact_studio_pico_16mb/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/weact_studio_pico_16mb/pins.c diff --git a/ports/raspberrypi/boards/weact_studio_pico_16mb/board.c b/ports/raspberrypi/boards/weact_studio_pico_16mb/board.c new file mode 100644 index 0000000000..76973aee30 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico_16mb/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Fabian Affolter + * + * 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/weact_studio_pico_16mb/mpconfigboard.h b/ports/raspberrypi/boards/weact_studio_pico_16mb/mpconfigboard.h new file mode 100644 index 0000000000..2dabc3eb1b --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico_16mb/mpconfigboard.h @@ -0,0 +1,2 @@ +#define MICROPY_HW_BOARD_NAME "WeAct Studio Pico 16MB" +#define MICROPY_HW_MCU_NAME "rp2040" diff --git a/ports/raspberrypi/boards/weact_studio_pico_16mb/mpconfigboard.mk b/ports/raspberrypi/boards/weact_studio_pico_16mb/mpconfigboard.mk new file mode 100644 index 0000000000..55209e1eb4 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico_16mb/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x239A +USB_PID = 0x102E +USB_PRODUCT = "Pico" +USB_MANUFACTURER = "WeAct Studio" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/weact_studio_pico_16mb/pico-sdk-configboard.h b/ports/raspberrypi/boards/weact_studio_pico_16mb/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico_16mb/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/weact_studio_pico_16mb/pins.c b/ports/raspberrypi/boards/weact_studio_pico_16mb/pins.c new file mode 100644 index 0000000000..8632d9c322 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico_16mb/pins.c @@ -0,0 +1,53 @@ +#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_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From cdab078d9dd24498f8abca423b96a40d18e05ae7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 14 Nov 2022 07:50:18 -0600 Subject: [PATCH 094/357] shared-bindings: Get rid of CYW43 special cases in shared-bindings .. by moving it into a new weak function that can be replaced just by the picow build. --- ports/raspberrypi/common-hal/analogio/AnalogIn.c | 5 +++++ .../raspberrypi/common-hal/digitalio/DigitalInOut.c | 4 ++++ shared-bindings/analogio/AnalogIn.c | 12 ++++-------- shared-bindings/analogio/AnalogIn.h | 1 + shared-bindings/digitalio/DigitalInOut.c | 13 +++++-------- shared-bindings/digitalio/DigitalInOut.h | 1 + 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ports/raspberrypi/common-hal/analogio/AnalogIn.c b/ports/raspberrypi/common-hal/analogio/AnalogIn.c index 0056eb17b5..8811cd54e4 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogIn.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogIn.c @@ -40,7 +40,12 @@ // voltage monitor function and the wifi function. Special handling is required // to read the analog voltage. #if CIRCUITPY_CYW43 +#include "bindings/cyw43/__init__.h" #define SPECIAL_PIN(pin) (pin->number == 29) + +const mcu_pin_obj_t *common_hal_analogio_analogin_validate_pin(mp_obj_t obj) { + return validate_obj_is_free_pin_or_gpio29(obj); +} #else #define SPECIAL_PIN(pin) false #endif diff --git a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c index 1490771661..eb498d3f19 100644 --- a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c +++ b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c @@ -41,6 +41,10 @@ #include "pico/cyw43_arch.h" #include "bindings/cyw43/__init__.h" #define IS_CYW(self) ((self)->pin->base.type == &cyw43_pin_type) + +const mcu_pin_obj_t *common_hal_digitalio_validate_pin(mp_obj_t obj) { + return validate_obj_is_free_pin_including_cyw43(obj); +} #endif digitalinout_result_t common_hal_digitalio_digitalinout_construct( diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 274bfa4806..800c0bfa21 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -36,9 +36,9 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/util.h" -#if CIRCUITPY_CYW43 -#include "bindings/cyw43/__init__.h" -#endif +MP_WEAK const mcu_pin_obj_t *common_hal_analogio_analogin_validate_pin(mp_obj_t obj) { + return validate_obj_is_free_pin(obj); +} //| class AnalogIn: //| """Read analog voltage levels @@ -64,11 +64,7 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, mp_arg_check_num(n_args, n_kw, 1, 1, false); // 1st argument is the pin - #if CIRCUITPY_CYW43 - const mcu_pin_obj_t *pin = validate_obj_is_free_pin_or_gpio29(args[0]); - #else - const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[0]); - #endif + const mcu_pin_obj_t *pin = common_hal_analogio_analogin_validate_pin(args[0]); analogio_analogin_obj_t *self = m_new_obj(analogio_analogin_obj_t); self->base.type = &analogio_analogin_type; common_hal_analogio_analogin_construct(self, pin); diff --git a/shared-bindings/analogio/AnalogIn.h b/shared-bindings/analogio/AnalogIn.h index 9f80416267..7d667ed3f4 100644 --- a/shared-bindings/analogio/AnalogIn.h +++ b/shared-bindings/analogio/AnalogIn.h @@ -32,6 +32,7 @@ extern const mp_obj_type_t analogio_analogin_type; +const mcu_pin_obj_t *common_hal_analogio_analogin_validate_pin(mp_obj_t obj); void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin); void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self); bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self); diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index e42036bb1a..eb3c1ec69d 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -66,6 +66,10 @@ STATIC void check_result(digitalinout_result_t result) { } } +MP_WEAK const mcu_pin_obj_t *common_hal_digitalio_validate_pin(mp_obj_t obj) { + return validate_obj_is_free_pin(obj); +} + //| class DigitalInOut: //| """Digital input and output //| @@ -87,14 +91,7 @@ STATIC mp_obj_t digitalio_digitalinout_make_new(const mp_obj_type_t *type, digitalio_digitalinout_obj_t *self = m_new_obj(digitalio_digitalinout_obj_t); self->base.type = &digitalio_digitalinout_type; - #if CIRCUITPY_CYW43 - // The GPIO pin attached to the CYW43 co-processor can only be used for - // DigitalInOut, not for other purposes like PWM. That's why this check - // is here, and it's not rolled into validate_obj_is_free_pin. - const mcu_pin_obj_t *pin = validate_obj_is_free_pin_including_cyw43(args[0]); - #else - const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[0]); - #endif + const mcu_pin_obj_t *pin = common_hal_digitalio_validate_pin(args[0]); common_hal_digitalio_digitalinout_construct(self, pin); return MP_OBJ_FROM_PTR(self); diff --git a/shared-bindings/digitalio/DigitalInOut.h b/shared-bindings/digitalio/DigitalInOut.h index 9a751e93bb..80c3970f0e 100644 --- a/shared-bindings/digitalio/DigitalInOut.h +++ b/shared-bindings/digitalio/DigitalInOut.h @@ -55,6 +55,7 @@ typedef enum { DIGITALINOUT_REG_TOGGLE, } digitalinout_reg_op_t; +const mcu_pin_obj_t *common_hal_digitalio_validate_pin(mp_obj_t obj); digitalinout_result_t common_hal_digitalio_digitalinout_construct(digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin); void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self); bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self); From adca341d3bff2ba123685b992267ad43c04c42e9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 14 Nov 2022 09:14:39 -0600 Subject: [PATCH 095/357] Save code space by packing rgbw values into C union It's more efficient passing one register-sized structure than 4 arguments or 4 pointers; working on intermediate values of 'int' size is also more efficient in code size! On raspberry pi pico w, this increased free flash space by +104 bytes. It also increased the speed of my testing animation very slightly, from 187fps to 189fps when run 'unthrottled' --- shared-bindings/adafruit_pixelbuf/PixelBuf.h | 7 +++ shared-module/adafruit_pixelbuf/PixelBuf.c | 58 ++++++++++---------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/shared-bindings/adafruit_pixelbuf/PixelBuf.h b/shared-bindings/adafruit_pixelbuf/PixelBuf.h index 7ae3d6acf8..e73d3e02d6 100644 --- a/shared-bindings/adafruit_pixelbuf/PixelBuf.h +++ b/shared-bindings/adafruit_pixelbuf/PixelBuf.h @@ -31,6 +31,13 @@ extern const mp_obj_type_t pixelbuf_pixelbuf_type; +typedef union { + struct { + uint8_t r, g, b, w; + }; + uint32_t rgbw; +} color_u; + void common_hal_adafruit_pixelbuf_pixelbuf_construct(pixelbuf_pixelbuf_obj_t *self, size_t n, pixelbuf_byteorder_details_t *byteorder, mp_float_t brightness, bool auto_write, uint8_t *header, size_t header_len, uint8_t *trailer, size_t trailer_len); diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index cab97feace..e0c63306f9 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -152,50 +152,56 @@ STATIC uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { translate("can't convert %q to %q"), mp_obj_get_type_qstr(obj), MP_QSTR_int); } -STATIC void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w) { +STATIC color_u _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color) { + color_u result; pixelbuf_byteorder_details_t *byteorder = &self->byteorder; // w is shared between white in NeoPixels and brightness in dotstars (so that DotStars can have // per-pixel brightness). Set the defaults here in case it isn't set below. if (byteorder->is_dotstar) { - *w = 255; + result.w = 255; } else { - *w = 0; + result.w = 0; } if (mp_obj_is_int(color) || mp_obj_is_float(color)) { mp_int_t value = mp_obj_is_int(color) ? mp_obj_get_int_truncated(color) : (mp_int_t)mp_obj_get_float(color); - *r = value >> 16 & 0xff; - *g = (value >> 8) & 0xff; - *b = value & 0xff; + result.r = value >> 16 & 0xff; + result.g = (value >> 8) & 0xff; + result.b = value & 0xff; } else { mp_obj_t *items; size_t len; mp_obj_get_array(color, &len, &items); mp_arg_validate_length_range(len, 3, 4, MP_QSTR_color); - *r = _pixelbuf_get_as_uint8(items[PIXEL_R]); - *g = _pixelbuf_get_as_uint8(items[PIXEL_G]); - *b = _pixelbuf_get_as_uint8(items[PIXEL_B]); + result.r = _pixelbuf_get_as_uint8(items[PIXEL_R]); + result.g = _pixelbuf_get_as_uint8(items[PIXEL_G]); + result.b = _pixelbuf_get_as_uint8(items[PIXEL_B]); if (len > 3) { if (mp_obj_is_float(items[PIXEL_W])) { - *w = 255 * mp_obj_get_float(items[PIXEL_W]); + result.w = 255 * mp_obj_get_float(items[PIXEL_W]); } else { - *w = mp_obj_get_int_truncated(items[PIXEL_W]); + result.w = mp_obj_get_int_truncated(items[PIXEL_W]); } - return; + return result; } } // Int colors can't set white directly so convert to white when all components are equal. // Also handles RGBW values assigned an RGB tuple. - if (!byteorder->is_dotstar && byteorder->bpp == 4 && byteorder->has_white && *r == *g && *r == *b) { - *w = *r; - *r = 0; - *g = 0; - *b = 0; + if (!byteorder->is_dotstar && byteorder->bpp == 4 && byteorder->has_white && result.r == result.g && result.r == result.b) { + result.w = result.r; + result.r = 0; + result.g = 0; + result.b = 0; } + return result; } -STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { +STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, color_u rgbw) { + int r = rgbw.r; + int g = rgbw.g; + int b = rgbw.b; + int w = rgbw.w; // DotStars don't have white, instead they have 5 bit brightness so pack it into w. Shift right // by three to leave the top five bits. if (self->bytes_per_pixel == 4 && self->byteorder.is_dotstar) { @@ -234,12 +240,8 @@ STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t inde } STATIC void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t *self, size_t index, mp_obj_t value) { - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t w; - _pixelbuf_parse_color(self, value, &r, &g, &b, &w); - _pixelbuf_set_pixel_color(self, index, r, g, b, w); + color_u rgbw = _pixelbuf_parse_color(self, value); + _pixelbuf_set_pixel_color(self, index, rgbw); } void common_hal_adafruit_pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t *values, @@ -318,14 +320,10 @@ void common_hal_adafruit_pixelbuf_pixelbuf_show(mp_obj_t self_in) { void common_hal_adafruit_pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t fill_color) { pixelbuf_pixelbuf_obj_t *self = native_pixelbuf(self_in); - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t w; - _pixelbuf_parse_color(self, fill_color, &r, &g, &b, &w); + color_u rgbw = _pixelbuf_parse_color(self, fill_color); for (size_t i = 0; i < self->pixel_count; i++) { - _pixelbuf_set_pixel_color(self, i, r, g, b, w); + _pixelbuf_set_pixel_color(self, i, rgbw); } if (self->auto_write) { common_hal_adafruit_pixelbuf_pixelbuf_show(self_in); From e53bbb1bd22a6c3842e7db2df1d05f144a23aa0b Mon Sep 17 00:00:00 2001 From: River Wang Date: Mon, 14 Nov 2022 15:46:58 +0000 Subject: [PATCH 096/357] Translated using Weblate (Chinese (Pinyin)) Currently translated at 97.3% (969 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 8dee6b5f2e..bee1c4d4b4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,15 +7,15 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-08-20 14:09+0000\n" -"Last-Translator: hexthat \n" +"PO-Revision-Date: 2022-11-14 15:47+0000\n" +"Last-Translator: River Wang \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.14-dev\n" +"X-Generator: Weblate 4.15-dev\n" #: main.c msgid "" @@ -740,6 +740,7 @@ msgid "Cannot get temperature" msgstr "Wúfǎ huòqǔ wēndù" #: shared-bindings/_bleio/Adapter.c +#, fuzzy msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "Nín wúfǎ sǎomiáo kuòzhǎn de, kě liánjiē de guǎnggào." From 2e6dd1bf1f1b41d0798a708e93559610e75aca6b Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Mon, 14 Nov 2022 18:36:42 +0200 Subject: [PATCH 097/357] Radio.c no longer needs ping.h --- ports/raspberrypi/common-hal/wifi/Radio.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 8073f57063..a59303a216 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -50,7 +50,6 @@ #include "lwip/dns.h" #include "lwip/icmp.h" #include "lwip/raw.h" -#include "lwip_src/ping.h" #ifndef PING_ID #define PING_ID 0xAFAF @@ -60,11 +59,6 @@ #define PING_DEBUG LWIP_DBG_ON #endif -#ifdef LWIP_DEBUG -static uint32_t ping_time; -#endif - - #define MAC_ADDRESS_LENGTH 6 #define NETIF_STA (&cyw43_state.netif[CYW43_ITF_STA]) @@ -305,6 +299,10 @@ void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv } volatile bool ping_received; +u16_t ping_seq_num; + +void ping_set_target(const ip_addr_t *ping_addr); +int ping_send(struct raw_pcb *raw, const ip_addr_t *addr); static u8_t ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) { @@ -313,6 +311,7 @@ ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) if ((p->tot_len >= (PBUF_IP_HLEN + sizeof(struct icmp_echo_hdr))) && pbuf_remove_header(p, PBUF_IP_HLEN) == 0) { + uint32_t ping_time = sys_now(); iecho = (struct icmp_echo_hdr *)p->payload; if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) { From 14b20087b562d1551d1275d5c3297627f93c5a80 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 14 Nov 2022 11:29:18 -0600 Subject: [PATCH 098/357] only ignore sdkconfig* files in the espressif port's top directory danh and microdev1 noticed that this ignore pattern was over-broad and caused added sdkconfig files in boards/ (which should be committed) to be ignored and not proposed for addition by common tools like git status, git gui, etc. This pattern anchors the search so that it only matches in the ports/espressif directory, so ports/espressif/sdkconfig is ignored but ports/espressif/boards/example/sdkconfig is not ignored anymore --- ports/espressif/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/.gitignore b/ports/espressif/.gitignore index d5350e07f9..63e4a35878 100644 --- a/ports/espressif/.gitignore +++ b/ports/espressif/.gitignore @@ -1,5 +1,5 @@ # idf.py menuconfig -./sdkconfig* +/sdkconfig* # lock files for examples and components dependencies.lock From 6ad61a3fd1f40e9ed8832eb083c660a1aea6029d Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Mon, 14 Nov 2022 19:31:18 +0200 Subject: [PATCH 099/357] Radio.c work --- ports/raspberrypi/common-hal/wifi/Radio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index a59303a216..4f32fad793 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -299,10 +299,9 @@ void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv } volatile bool ping_received; -u16_t ping_seq_num; - -void ping_set_target(const ip_addr_t *ping_addr); int ping_send(struct raw_pcb *raw, const ip_addr_t *addr); +uint16_t ping_seq_num; +uint32_t ping_time; static u8_t ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) { @@ -311,7 +310,7 @@ ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) if ((p->tot_len >= (PBUF_IP_HLEN + sizeof(struct icmp_echo_hdr))) && pbuf_remove_header(p, PBUF_IP_HLEN) == 0) { - uint32_t ping_time = sys_now(); + iecho = (struct icmp_echo_hdr *)p->payload; if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) { @@ -331,6 +330,7 @@ ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) } mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout) { + ping_time = sys_now(); ip_addr_t ping_addr; ipaddress_ipaddress_to_lwip(ip_address, &ping_addr); From 398e9122a0a4b8ba7ba148f31c09921d01c4ab69 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Mon, 14 Nov 2022 19:33:06 +0200 Subject: [PATCH 100/357] remove lwip_src --- ports/raspberrypi/lwip_src/ping.c | 384 ------------------------------ ports/raspberrypi/lwip_src/ping.h | 25 -- 2 files changed, 409 deletions(-) delete mode 100644 ports/raspberrypi/lwip_src/ping.c delete mode 100644 ports/raspberrypi/lwip_src/ping.h diff --git a/ports/raspberrypi/lwip_src/ping.c b/ports/raspberrypi/lwip_src/ping.c deleted file mode 100644 index e59b4d6662..0000000000 --- a/ports/raspberrypi/lwip_src/ping.c +++ /dev/null @@ -1,384 +0,0 @@ -/** - * @file - * Ping sender module - * - */ - -/* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - */ - -/** - * This is an example of a "ping" sender (with raw API and socket API). - * It can be used as a start point to maintain opened a network connection, or - * like a network "watchdog" for your device. - * - */ - -#include "lwip/opt.h" - -#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ - -#include "ping.h" - -#include "lwip/mem.h" -#include "lwip/raw.h" -#include "lwip/icmp.h" -#include "lwip/netif.h" -#include "lwip/sys.h" -#include "lwip/timeouts.h" -#include "lwip/inet_chksum.h" -#include "lwip/prot/ip4.h" - -#if PING_USE_SOCKETS -#include "lwip/sockets.h" -#include "lwip/inet.h" -#include -#endif /* PING_USE_SOCKETS */ - - -/** - * PING_DEBUG: Enable debugging for PING. - */ -#ifndef PING_DEBUG -#define PING_DEBUG LWIP_DBG_ON -#endif - -/** ping receive timeout - in milliseconds */ -#ifndef PING_RCV_TIMEO -#define PING_RCV_TIMEO 1000 -#endif - -/** ping delay - in milliseconds */ -#ifndef PING_DELAY -#define PING_DELAY 1000 -#endif - -/** ping identifier - must fit on a u16_t */ -#ifndef PING_ID -#define PING_ID 0xAFAF -#endif - -/** ping additional data size to include in the packet */ -#ifndef PING_DATA_SIZE -#define PING_DATA_SIZE 32 -#endif - -/** ping result action - no default action */ -#ifndef PING_RESULT -#define PING_RESULT(ping_ok) -#endif - -/* ping variables */ -static const ip_addr_t *ping_target; -u16_t ping_seq_num; -#ifdef LWIP_DEBUG -static u32_t ping_time; -#endif /* LWIP_DEBUG */ -#if !PING_USE_SOCKETS -static struct raw_pcb *ping_pcb; -#endif /* PING_USE_SOCKETS */ - -/** Prepare a echo ICMP request */ -void -ping_prepare_echo(struct icmp_echo_hdr *iecho, u16_t len) { - size_t i; - size_t data_len = len - sizeof(struct icmp_echo_hdr); - - ICMPH_TYPE_SET(iecho, ICMP_ECHO); - ICMPH_CODE_SET(iecho, 0); - iecho->chksum = 0; - iecho->id = PING_ID; - iecho->seqno = lwip_htons(++ping_seq_num); - - /* fill the additional data buffer with some data */ - for (i = 0; i < data_len; i++) { - ((char *)iecho)[sizeof(struct icmp_echo_hdr) + i] = (char)i; - } - - iecho->chksum = inet_chksum(iecho, len); -} - -#if PING_USE_SOCKETS - -/* Ping using the socket ip */ -err_t -ping_send(int s, const ip_addr_t *addr) { - int err; - struct icmp_echo_hdr *iecho; - struct sockaddr_storage to; - size_t ping_size = sizeof(struct icmp_echo_hdr) + PING_DATA_SIZE; - LWIP_ASSERT("ping_size is too big", ping_size <= 0xffff); - - #if LWIP_IPV6 - if (IP_IS_V6(addr) && !ip6_addr_isipv4mappedipv6(ip_2_ip6(addr))) { - /* todo: support ICMP6 echo */ - return ERR_VAL; - } - #endif /* LWIP_IPV6 */ - - iecho = (struct icmp_echo_hdr *)mem_malloc((mem_size_t)ping_size); - if (!iecho) { - return ERR_MEM; - } - - ping_prepare_echo(iecho, (u16_t)ping_size); - - #if LWIP_IPV4 - if (IP_IS_V4(addr)) { - struct sockaddr_in *to4 = (struct sockaddr_in *)&to; - to4->sin_len = sizeof(*to4); - to4->sin_family = AF_INET; - inet_addr_from_ip4addr(&to4->sin_addr, ip_2_ip4(addr)); - } - #endif /* LWIP_IPV4 */ - - #if LWIP_IPV6 - if (IP_IS_V6(addr)) { - struct sockaddr_in6 *to6 = (struct sockaddr_in6 *)&to; - to6->sin6_len = sizeof(*to6); - to6->sin6_family = AF_INET6; - inet6_addr_from_ip6addr(&to6->sin6_addr, ip_2_ip6(addr)); - } - #endif /* LWIP_IPV6 */ - - err = lwip_sendto(s, iecho, ping_size, 0, (struct sockaddr *)&to, sizeof(to)); - - mem_free(iecho); - - return err ? ERR_OK : ERR_VAL; -} - -static void -ping_recv(int s) { - char buf[64]; - int len; - struct sockaddr_storage from; - int fromlen = sizeof(from); - - while ((len = lwip_recvfrom(s, buf, sizeof(buf), 0, (struct sockaddr *)&from, (socklen_t *)&fromlen)) > 0) { - if (len >= (int)(sizeof(struct ip_hdr) + sizeof(struct icmp_echo_hdr))) { - ip_addr_t fromaddr; - memset(&fromaddr, 0, sizeof(fromaddr)); - - #if LWIP_IPV4 - if (from.ss_family == AF_INET) { - struct sockaddr_in *from4 = (struct sockaddr_in *)&from; - inet_addr_to_ip4addr(ip_2_ip4(&fromaddr), &from4->sin_addr); - IP_SET_TYPE_VAL(fromaddr, IPADDR_TYPE_V4); - } - #endif /* LWIP_IPV4 */ - - #if LWIP_IPV6 - if (from.ss_family == AF_INET6) { - struct sockaddr_in6 *from6 = (struct sockaddr_in6 *)&from; - inet6_addr_to_ip6addr(ip_2_ip6(&fromaddr), &from6->sin6_addr); - IP_SET_TYPE_VAL(fromaddr, IPADDR_TYPE_V6); - } - #endif /* LWIP_IPV6 */ - - LWIP_DEBUGF(PING_DEBUG, ("ping: recv ")); - ip_addr_debug_print_val(PING_DEBUG, fromaddr); - LWIP_DEBUGF(PING_DEBUG, (" %"U32_F " ms\n", (sys_now() - ping_time))); - - /* todo: support ICMP6 echo */ - #if LWIP_IPV4 - if (IP_IS_V4_VAL(fromaddr)) { - struct ip_hdr *iphdr; - struct icmp_echo_hdr *iecho; - - iphdr = (struct ip_hdr *)buf; - iecho = (struct icmp_echo_hdr *)(buf + (IPH_HL(iphdr) * 4)); - if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) { - /* do some ping result processing */ - PING_RESULT((ICMPH_TYPE(iecho) == ICMP_ER)); - return; - } else { - LWIP_DEBUGF(PING_DEBUG, ("ping: drop\n")); - } - } - #endif /* LWIP_IPV4 */ - } - fromlen = sizeof(from); - } - - if (len == 0) { - LWIP_DEBUGF(PING_DEBUG, ("ping: recv - %"U32_F " ms - timeout\n", (sys_now() - ping_time))); - } - - /* do some ping result processing */ - PING_RESULT(0); -} - -static void -ping_thread(void *arg) { - int s; - int ret; - - #if LWIP_SO_SNDRCVTIMEO_NONSTANDARD - int timeout = PING_RCV_TIMEO; - #else - struct timeval timeout; - timeout.tv_sec = PING_RCV_TIMEO / 1000; - timeout.tv_usec = (PING_RCV_TIMEO % 1000) * 1000; - #endif - LWIP_UNUSED_ARG(arg); - - #if LWIP_IPV6 - if (IP_IS_V4(ping_target) || ip6_addr_isipv4mappedipv6(ip_2_ip6(ping_target))) { - s = lwip_socket(AF_INET6, SOCK_RAW, IP_PROTO_ICMP); - } else { - s = lwip_socket(AF_INET6, SOCK_RAW, IP6_NEXTH_ICMP6); - } - #else - s = lwip_socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP); - #endif - if (s < 0) { - return; - } - - ret = lwip_setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); - LWIP_ASSERT("setting receive timeout failed", ret == 0); - LWIP_UNUSED_ARG(ret); - - while (1) { - if (ping_send(s, ping_target) == ERR_OK) { - LWIP_DEBUGF(PING_DEBUG, ("ping: send ")); - ip_addr_debug_print(PING_DEBUG, ping_target); - LWIP_DEBUGF(PING_DEBUG, ("\n")); - - #ifdef LWIP_DEBUG - ping_time = sys_now(); - #endif /* LWIP_DEBUG */ - ping_recv(s); - } else { - LWIP_DEBUGF(PING_DEBUG, ("ping: send ")); - ip_addr_debug_print(PING_DEBUG, ping_target); - LWIP_DEBUGF(PING_DEBUG, (" - error\n")); - } - sys_msleep(PING_DELAY); - } -} - -#else /* PING_USE_SOCKETS */ - -/* Ping using the raw ip */ -static u8_t -ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) { - struct icmp_echo_hdr *iecho; - LWIP_UNUSED_ARG(arg); - LWIP_UNUSED_ARG(pcb); - LWIP_UNUSED_ARG(addr); - LWIP_ASSERT("p != NULL", p != NULL); - - if ((p->tot_len >= (PBUF_IP_HLEN + sizeof(struct icmp_echo_hdr))) && - pbuf_remove_header(p, PBUF_IP_HLEN) == 0) { - iecho = (struct icmp_echo_hdr *)p->payload; - - if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) { - LWIP_DEBUGF(PING_DEBUG, ("ping: recv ")); - ip_addr_debug_print(PING_DEBUG, addr); - LWIP_DEBUGF(PING_DEBUG, (" %"U32_F " ms\n", (sys_now() - ping_time))); - - /* do some ping result processing */ - PING_RESULT(1); - pbuf_free(p); - return 1; /* eat the packet */ - } - /* not eaten, restore original packet */ - pbuf_add_header(p, PBUF_IP_HLEN); - } - - return 0; /* don't eat the packet */ -} - -int -ping_send(struct raw_pcb *raw, const ip_addr_t *addr) { - struct pbuf *p; - struct icmp_echo_hdr *iecho; - size_t ping_size = sizeof(struct icmp_echo_hdr) + PING_DATA_SIZE; - - LWIP_DEBUGF(PING_DEBUG, ("ping: send ")); - ip_addr_debug_print(PING_DEBUG, addr); - LWIP_DEBUGF(PING_DEBUG, ("\n")); - LWIP_ASSERT("ping_size <= 0xffff", ping_size <= 0xffff); - - p = pbuf_alloc(PBUF_IP, (u16_t)ping_size, PBUF_RAM); - if (!p) { - return 0; - } - if ((p->len == p->tot_len) && (p->next == NULL)) { - iecho = (struct icmp_echo_hdr *)p->payload; - - ping_prepare_echo(iecho, (u16_t)ping_size); - - raw_sendto(raw, p, addr); - #ifdef LWIP_DEBUG - ping_time = sys_now(); - #endif /* LWIP_DEBUG */ - } - pbuf_free(p); - return 1; -} - -static void -ping_timeout(void *arg) { - struct raw_pcb *pcb = (struct raw_pcb *)arg; - - LWIP_ASSERT("ping_timeout: no pcb given!", pcb != NULL); - - ping_send(pcb, ping_target); - - sys_timeout(PING_DELAY, ping_timeout, pcb); -} - -static void -ping_raw_init(void) { - if (ping_pcb) { - return; - } - ping_pcb = raw_new(IP_PROTO_ICMP); - LWIP_ASSERT("ping_pcb != NULL", ping_pcb != NULL); - - raw_recv(ping_pcb, ping_recv, NULL); - raw_bind(ping_pcb, IP_ADDR_ANY); - sys_timeout(PING_DELAY, ping_timeout, ping_pcb); -} - -#endif /* PING_USE_SOCKETS */ - -void -ping_init(const ip_addr_t *ping_addr) { - ping_target = ping_addr; - - #if PING_USE_SOCKETS - sys_thread_new("ping_thread", ping_thread, NULL, DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO); - #else /* PING_USE_SOCKETS */ - ping_raw_init(); - #endif /* PING_USE_SOCKETS */ -} - -#endif /* LWIP_RAW */ diff --git a/ports/raspberrypi/lwip_src/ping.h b/ports/raspberrypi/lwip_src/ping.h deleted file mode 100644 index abbae9d086..0000000000 --- a/ports/raspberrypi/lwip_src/ping.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef LWIP_PING_H -#define LWIP_PING_H - -#include "lwip/raw.h" -#include "lwip/ip_addr.h" -#include "lwip/prot/icmp.h" - -/** - * PING_USE_SOCKETS: Set to 1 to use sockets, otherwise the raw api is used - */ -#ifndef PING_USE_SOCKETS -#define PING_USE_SOCKETS LWIP_SOCKET -#endif - -void ping_init(const ip_addr_t *ping_addr); -void ping_prepare_echo(struct icmp_echo_hdr *iecho, u16_t len); - -extern u16_t ping_seq_num; -#if !PING_USE_SOCKETS -void ping_set_target(const ip_addr_t *ping_addr); -int ping_send(struct raw_pcb *raw, const ip_addr_t *addr); -// u8_t ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr); -#endif /* !PING_USE_SOCKETS */ - -#endif /* LWIP_PING_H */ From fdeaf805d330543ce317eccfed662048d83064ec Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 13 Nov 2022 18:17:47 -0500 Subject: [PATCH 101/357] STM: off-by-one TIMx reference; other code cleanup and minor fixes --- ports/stm/common-hal/pulseio/PulseIn.c | 3 +- ports/stm/common-hal/pwmio/PWMOut.c | 97 ++++++++++++-------------- ports/stm/common-hal/pwmio/PWMOut.h | 6 +- ports/stm/peripherals/timers.c | 58 ++++++++++++--- 4 files changed, 100 insertions(+), 64 deletions(-) diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 4ed2600d55..5b7602d9bf 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -106,7 +106,8 @@ void pulsein_reset(void) { memset(callback_obj_ref, 0, sizeof(callback_obj_ref)); HAL_TIM_Base_DeInit(&tim_handle); - tim_clock_disable(stm_peripherals_timer_get_index(tim_handle.Instance)); + // tim_clock_disable() takes a bitmask of timers. + tim_clock_disable(1 << stm_peripherals_timer_get_index(tim_handle.Instance)); memset(&tim_handle, 0, sizeof(tim_handle)); refcount = 0; } diff --git a/ports/stm/common-hal/pwmio/PWMOut.c b/ports/stm/common-hal/pwmio/PWMOut.c index 16d510b605..cc712497d2 100644 --- a/ports/stm/common-hal/pwmio/PWMOut.c +++ b/ports/stm/common-hal/pwmio/PWMOut.c @@ -36,23 +36,24 @@ #include "timers.h" -#define ALL_CLOCKS 0xFFFF - -STATIC uint8_t reserved_tim[TIM_BANK_ARRAY_LEN]; +// Bitmask of channels taken. +STATIC uint8_t tim_channels_taken[TIM_BANK_ARRAY_LEN]; +// Initial frequency timer is set to. STATIC uint32_t tim_frequencies[TIM_BANK_ARRAY_LEN]; STATIC bool never_reset_tim[TIM_BANK_ARRAY_LEN]; STATIC uint32_t timer_get_internal_duty(uint16_t duty, uint32_t period) { // duty cycle is duty/0xFFFF fraction x (number of pulses per period) - return (duty * period) / ((1 << 16) - 1); + return (duty * period) / 0xffff; } STATIC bool timer_get_optimal_divisors(uint32_t *period, uint32_t *prescaler, uint32_t frequency, uint32_t source_freq) { // Find the largest possible period supported by this frequency - for (int i = 0; i < (1 << 16); i++) { + *prescaler = 0; + for (uint32_t i = 1; i <= 0xffff; i++) { *period = source_freq / (i * frequency); - if (*period < (1 << 16) && *period >= 2) { + if (*period <= 0xffff && *period >= 2) { *prescaler = i; break; } @@ -62,13 +63,10 @@ STATIC bool timer_get_optimal_divisors(uint32_t *period, uint32_t *prescaler, } void pwmout_reset(void) { - uint16_t never_reset_mask = 0x00; for (int i = 0; i < TIM_BANK_ARRAY_LEN; i++) { if (!never_reset_tim[i]) { - reserved_tim[i] = 0x00; - tim_frequencies[i] = 0x00; - } else { - never_reset_mask |= 1 << i; + tim_channels_taken[i] = 0x00; + tim_frequencies[i] = 0; } } } @@ -78,73 +76,69 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, uint16_t duty, uint32_t frequency, bool variable_frequency) { - TIM_TypeDef *TIMx; - uint8_t tim_num = MP_ARRAY_SIZE(mcu_tim_pin_list); - bool tim_taken_internal = false; - bool tim_chan_taken = false; - bool tim_taken_f_mismatch = false; - bool var_freq_mismatch = false; + // Default error is no timer at all on pin. + pwmout_result_t last_failure = PWMOUT_INVALID_PIN; bool first_time_setup = true; - for (uint i = 0; i < tim_num; i++) { - const mcu_tim_pin_obj_t *l_tim = &mcu_tim_pin_list[i]; - uint8_t l_tim_index = l_tim->tim_index; - uint8_t l_tim_channel = l_tim->channel_index; + uint8_t tim_index; + uint8_t tim_channel_index; + + self->tim = NULL; + for (uint i = 0; i < MP_ARRAY_SIZE(mcu_tim_pin_list); i++) { + const mcu_tim_pin_obj_t *tim = &mcu_tim_pin_list[i]; + tim_index = tim->tim_index; + tim_channel_index = tim->channel_index; // if pin is same - if (l_tim->pin == pin) { + if (tim->pin == pin) { // check if the timer has a channel active, or is reserved by main timer system - if (l_tim_index < TIM_BANK_ARRAY_LEN && reserved_tim[l_tim_index] != 0) { + if (tim_index < TIM_BANK_ARRAY_LEN && tim_channels_taken[tim_index] != 0) { // Timer has already been reserved by an internal module - if (stm_peripherals_timer_is_reserved(mcu_tim_banks[l_tim_index])) { - tim_taken_internal = true; + if (stm_peripherals_timer_is_reserved(mcu_tim_banks[tim_index])) { + last_failure = PWMOUT_ALL_TIMERS_ON_PIN_IN_USE; continue; // keep looking } // is it the same channel? (or all channels reserved by a var-freq) - if (reserved_tim[l_tim_index] & 1 << (l_tim_channel)) { - tim_chan_taken = true; + if (tim_channels_taken[tim_index] & (1 << tim_channel_index)) { + last_failure = PWMOUT_ALL_TIMERS_ON_PIN_IN_USE; continue; // keep looking, might be another viable option } // If the frequencies are the same it's ok - if (tim_frequencies[l_tim_index] != frequency) { - tim_taken_f_mismatch = true; + if (tim_frequencies[tim_index] != frequency) { + last_failure = PWMOUT_INVALID_FREQUENCY_ON_PIN; continue; // keep looking } // you can't put a variable frequency on a partially reserved timer if (variable_frequency) { - var_freq_mismatch = true; + last_failure = PWMOUT_VARIABLE_FREQUENCY_NOT_AVAILABLE; continue; // keep looking } first_time_setup = false; // skip setting up the timer } // No problems taken, so set it up - self->tim = l_tim; + self->tim = tim; break; } } + TIM_TypeDef *TIMx; + // handle valid/invalid timer instance if (self->tim != NULL) { // create instance - TIMx = mcu_tim_banks[self->tim->tim_index]; + TIMx = mcu_tim_banks[tim_index]; // reserve timer/channel if (variable_frequency) { - reserved_tim[self->tim->tim_index] = 0x0F; + // Take all the channels. + tim_channels_taken[tim_index] = 0x0F; } else { - reserved_tim[self->tim->tim_index] |= 1 << self->tim->channel_index; + tim_channels_taken[tim_index] |= 1 << tim_channel_index; } - tim_frequencies[self->tim->tim_index] = frequency; + tim_frequencies[tim_index] = frequency; stm_peripherals_timer_reserve(TIMx); - } else { // no match found - if (tim_chan_taken || tim_taken_internal) { - return PWMOUT_ALL_TIMERS_ON_PIN_IN_USE; - } else if (tim_taken_f_mismatch) { - return PWMOUT_INVALID_FREQUENCY_ON_PIN; - } else if (var_freq_mismatch) { - return PWMOUT_VARIABLE_FREQUENCY_NOT_AVAILABLE; - } else { - return PWMOUT_INVALID_PIN; - } + } else { + // no match found + return last_failure; } uint32_t prescaler = 0; // prescaler is 15 bit @@ -163,10 +157,10 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, HAL_GPIO_Init(pin_port(pin->port), &GPIO_InitStruct); self->pin = pin; - tim_clock_enable(1 << (self->tim->tim_index)); + tim_clock_enable(1 << tim_index); - // translate channel into handle value - self->channel = 4 * self->tim->channel_index; + // translate channel into handle value: TIM_CHANNEL_1, _2, _3, _4. + self->channel = 4 * tim_channel_index; // Timer init self->handle.Instance = TIMx; @@ -175,6 +169,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, self->handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; self->handle.Init.CounterMode = TIM_COUNTERMODE_UP; self->handle.Init.RepetitionCounter = 0; + self->handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; // only run init if this is the first instance of this timer if (first_time_setup) { @@ -232,15 +227,15 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { } // var freq shuts down entire timer, others just their channel if (self->variable_frequency) { - reserved_tim[self->tim->tim_index] = 0x00; + tim_channels_taken[self->tim->tim_index] = 0x00; } else { - reserved_tim[self->tim->tim_index] &= ~(1 << self->tim->channel_index); + tim_channels_taken[self->tim->tim_index] &= ~(1 << self->tim->channel_index); HAL_TIM_PWM_Stop(&self->handle, self->channel); } common_hal_reset_pin(self->pin); // if reserved timer has no active channels, we can disable it - if (reserved_tim[self->tim->tim_index] == 0) { + if (tim_channels_taken[self->tim->tim_index] == 0) { tim_frequencies[self->tim->tim_index] = 0x00; stm_peripherals_timer_free(self->handle.Instance); } diff --git a/ports/stm/common-hal/pwmio/PWMOut.h b/ports/stm/common-hal/pwmio/PWMOut.h index de3a304721..9a8b897c6c 100644 --- a/ports/stm/common-hal/pwmio/PWMOut.h +++ b/ports/stm/common-hal/pwmio/PWMOut.h @@ -39,12 +39,12 @@ typedef struct { TIM_HandleTypeDef handle; TIM_OC_InitTypeDef chan_handle; const mcu_tim_pin_obj_t *tim; - uint8_t channel : 7; - bool variable_frequency : 1; - uint16_t duty_cycle; uint32_t frequency; uint32_t period; const mcu_pin_obj_t *pin; + uint16_t duty_cycle; + uint8_t channel; + bool variable_frequency; } pwmio_pwmout_obj_t; void pwmout_reset(void); diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index ed0f2ec38a..20b6bcc759 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -150,26 +150,65 @@ static size_t irq_map[] = { }; // Get the frequency (in Hz) of the source clock for the given timer. -// On STM32F405/407/415/417 there are 2 cases for how the clock freq is set. -// If the APB prescaler is 1, then the timer clock is equal to its respective -// APB clock. Otherwise (APB prescaler > 1) the timer clock is twice its -// respective APB clock. See DM00031020 Rev 4, page 115. +// +// From STM ref manual: DM00031020 Rev 19, section 7.2, page 217: +// +// The timer clock frequencies for STM32F405xx/07xx and STM32F415xx/17xx are +// automatically set by hardware. There are two cases: +// 1. If the APB prescaler is 1, the timer clock frequencies are set to the same frequency as +// that of the APB domain to which the timers are connected. +// 2. Otherwise, they are set to twice (×2) the frequency of the APB domain to which the +// timers are connected. + +// From STM ref manual: DM00031020 Rev 19, section 6.2, page 153: +// +// The timer clock frequencies for STM32F42xxx and STM32F43xxx are automatically set by +// hardware. There are two cases depending on the value of TIMPRE bit in RCC_CFGR [sic - should be RCC_DKCFGR] +// register: +// * If TIMPRE bit in RCC_DKCFGR register is reset: +// If the APB prescaler is configured to a division factor of 1, the timer clock frequencies +// (TIMxCLK) are set to PCLKx. Otherwise, the timer clock frequencies are twice the +// frequency of the APB domain to which the timers are connected: TIMxCLK = 2xPCLKx. +// * If TIMPRE bit in RCC_DKCFGR register is set: +// If the APB prescaler is configured to a division factor of 1, 2 or 4, the timer clock +// frequencies (TIMxCLK) are set to HCLK. Otherwise, the timer clock frequencies is four +// times the frequency of the APB domain to which the timers are connected: TIMxCLK = 4xPCLKx. + uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef *timer) { - size_t tim_id = stm_peripherals_timer_get_index(timer); + // The timer index starts at 0, but the timer numbers start at TIM1. + size_t tim_id = stm_peripherals_timer_get_index(timer) + 1; uint32_t source, clk_div; if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) { // TIM{1,8,9,10,11} are on APB2 source = HAL_RCC_GetPCLK2Freq(); - clk_div = RCC->CFGR & RCC_CFGR_PPRE2; + // 0b0xx means not divided; 0b100 is divide by 2; 0b101 by 4; 0b110 by 8; 0b111 by 16. + clk_div = (RCC->CFGR & RCC_CFGR_PPRE2) >> RCC_CFGR_PPRE2_Pos; } else { // TIM{2,3,4,5,6,7,12,13,14} are on APB1 source = HAL_RCC_GetPCLK1Freq(); - clk_div = RCC->CFGR & RCC_CFGR_PPRE1; + // 0b0xx means not divided; 0b100 is divide by 2; 0b101 by 4; 0b110 by 8; 0b111 by 16. + clk_div = (RCC->CFGR & RCC_CFGR_PPRE1) >> RCC_CFGR_PPRE1_Pos; } - if (clk_div != 0) { - // APB prescaler for this timer is > 1 + + // Only some STM32's have TIMPRE. + #if defined(RCC_CFGR_TIMPRE) + uint32_t timpre = RCC->DCKCFGR & RCC_CFGR_TIMPRE; + if (timpre == 0) { + if (clk_div >= 0b100) { + source *= 2; + } + } else { + if (clk_div > 0b101) { + source *= 4; + } else { + source = HAL_RCC_GetHCLKFreq(); + } + } + #else + if (clk_div >= 0b100) { source *= 2; } + #endif return source; } @@ -271,6 +310,7 @@ bool stm_peripherals_timer_is_reserved(TIM_TypeDef *instance) { return stm_timer_reserved[tim_idx]; } +// Note this returns a timer index starting at zero, corresponding to TIM1. size_t stm_peripherals_timer_get_index(TIM_TypeDef *instance) { for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) { if (instance == mcu_tim_banks[i]) { From fde1c05e6d558b220518bbf7aea7de2bb82b39b3 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Mon, 14 Nov 2022 19:54:21 +0200 Subject: [PATCH 102/357] Revert "remove lwip_src" This reverts commit 398e9122a0a4b8ba7ba148f31c09921d01c4ab69. It fails on LINK without them. --- ports/raspberrypi/lwip_src/ping.c | 384 ++++++++++++++++++++++++++++++ ports/raspberrypi/lwip_src/ping.h | 25 ++ 2 files changed, 409 insertions(+) create mode 100644 ports/raspberrypi/lwip_src/ping.c create mode 100644 ports/raspberrypi/lwip_src/ping.h diff --git a/ports/raspberrypi/lwip_src/ping.c b/ports/raspberrypi/lwip_src/ping.c new file mode 100644 index 0000000000..e59b4d6662 --- /dev/null +++ b/ports/raspberrypi/lwip_src/ping.c @@ -0,0 +1,384 @@ +/** + * @file + * Ping sender module + * + */ + +/* + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +/** + * This is an example of a "ping" sender (with raw API and socket API). + * It can be used as a start point to maintain opened a network connection, or + * like a network "watchdog" for your device. + * + */ + +#include "lwip/opt.h" + +#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ + +#include "ping.h" + +#include "lwip/mem.h" +#include "lwip/raw.h" +#include "lwip/icmp.h" +#include "lwip/netif.h" +#include "lwip/sys.h" +#include "lwip/timeouts.h" +#include "lwip/inet_chksum.h" +#include "lwip/prot/ip4.h" + +#if PING_USE_SOCKETS +#include "lwip/sockets.h" +#include "lwip/inet.h" +#include +#endif /* PING_USE_SOCKETS */ + + +/** + * PING_DEBUG: Enable debugging for PING. + */ +#ifndef PING_DEBUG +#define PING_DEBUG LWIP_DBG_ON +#endif + +/** ping receive timeout - in milliseconds */ +#ifndef PING_RCV_TIMEO +#define PING_RCV_TIMEO 1000 +#endif + +/** ping delay - in milliseconds */ +#ifndef PING_DELAY +#define PING_DELAY 1000 +#endif + +/** ping identifier - must fit on a u16_t */ +#ifndef PING_ID +#define PING_ID 0xAFAF +#endif + +/** ping additional data size to include in the packet */ +#ifndef PING_DATA_SIZE +#define PING_DATA_SIZE 32 +#endif + +/** ping result action - no default action */ +#ifndef PING_RESULT +#define PING_RESULT(ping_ok) +#endif + +/* ping variables */ +static const ip_addr_t *ping_target; +u16_t ping_seq_num; +#ifdef LWIP_DEBUG +static u32_t ping_time; +#endif /* LWIP_DEBUG */ +#if !PING_USE_SOCKETS +static struct raw_pcb *ping_pcb; +#endif /* PING_USE_SOCKETS */ + +/** Prepare a echo ICMP request */ +void +ping_prepare_echo(struct icmp_echo_hdr *iecho, u16_t len) { + size_t i; + size_t data_len = len - sizeof(struct icmp_echo_hdr); + + ICMPH_TYPE_SET(iecho, ICMP_ECHO); + ICMPH_CODE_SET(iecho, 0); + iecho->chksum = 0; + iecho->id = PING_ID; + iecho->seqno = lwip_htons(++ping_seq_num); + + /* fill the additional data buffer with some data */ + for (i = 0; i < data_len; i++) { + ((char *)iecho)[sizeof(struct icmp_echo_hdr) + i] = (char)i; + } + + iecho->chksum = inet_chksum(iecho, len); +} + +#if PING_USE_SOCKETS + +/* Ping using the socket ip */ +err_t +ping_send(int s, const ip_addr_t *addr) { + int err; + struct icmp_echo_hdr *iecho; + struct sockaddr_storage to; + size_t ping_size = sizeof(struct icmp_echo_hdr) + PING_DATA_SIZE; + LWIP_ASSERT("ping_size is too big", ping_size <= 0xffff); + + #if LWIP_IPV6 + if (IP_IS_V6(addr) && !ip6_addr_isipv4mappedipv6(ip_2_ip6(addr))) { + /* todo: support ICMP6 echo */ + return ERR_VAL; + } + #endif /* LWIP_IPV6 */ + + iecho = (struct icmp_echo_hdr *)mem_malloc((mem_size_t)ping_size); + if (!iecho) { + return ERR_MEM; + } + + ping_prepare_echo(iecho, (u16_t)ping_size); + + #if LWIP_IPV4 + if (IP_IS_V4(addr)) { + struct sockaddr_in *to4 = (struct sockaddr_in *)&to; + to4->sin_len = sizeof(*to4); + to4->sin_family = AF_INET; + inet_addr_from_ip4addr(&to4->sin_addr, ip_2_ip4(addr)); + } + #endif /* LWIP_IPV4 */ + + #if LWIP_IPV6 + if (IP_IS_V6(addr)) { + struct sockaddr_in6 *to6 = (struct sockaddr_in6 *)&to; + to6->sin6_len = sizeof(*to6); + to6->sin6_family = AF_INET6; + inet6_addr_from_ip6addr(&to6->sin6_addr, ip_2_ip6(addr)); + } + #endif /* LWIP_IPV6 */ + + err = lwip_sendto(s, iecho, ping_size, 0, (struct sockaddr *)&to, sizeof(to)); + + mem_free(iecho); + + return err ? ERR_OK : ERR_VAL; +} + +static void +ping_recv(int s) { + char buf[64]; + int len; + struct sockaddr_storage from; + int fromlen = sizeof(from); + + while ((len = lwip_recvfrom(s, buf, sizeof(buf), 0, (struct sockaddr *)&from, (socklen_t *)&fromlen)) > 0) { + if (len >= (int)(sizeof(struct ip_hdr) + sizeof(struct icmp_echo_hdr))) { + ip_addr_t fromaddr; + memset(&fromaddr, 0, sizeof(fromaddr)); + + #if LWIP_IPV4 + if (from.ss_family == AF_INET) { + struct sockaddr_in *from4 = (struct sockaddr_in *)&from; + inet_addr_to_ip4addr(ip_2_ip4(&fromaddr), &from4->sin_addr); + IP_SET_TYPE_VAL(fromaddr, IPADDR_TYPE_V4); + } + #endif /* LWIP_IPV4 */ + + #if LWIP_IPV6 + if (from.ss_family == AF_INET6) { + struct sockaddr_in6 *from6 = (struct sockaddr_in6 *)&from; + inet6_addr_to_ip6addr(ip_2_ip6(&fromaddr), &from6->sin6_addr); + IP_SET_TYPE_VAL(fromaddr, IPADDR_TYPE_V6); + } + #endif /* LWIP_IPV6 */ + + LWIP_DEBUGF(PING_DEBUG, ("ping: recv ")); + ip_addr_debug_print_val(PING_DEBUG, fromaddr); + LWIP_DEBUGF(PING_DEBUG, (" %"U32_F " ms\n", (sys_now() - ping_time))); + + /* todo: support ICMP6 echo */ + #if LWIP_IPV4 + if (IP_IS_V4_VAL(fromaddr)) { + struct ip_hdr *iphdr; + struct icmp_echo_hdr *iecho; + + iphdr = (struct ip_hdr *)buf; + iecho = (struct icmp_echo_hdr *)(buf + (IPH_HL(iphdr) * 4)); + if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) { + /* do some ping result processing */ + PING_RESULT((ICMPH_TYPE(iecho) == ICMP_ER)); + return; + } else { + LWIP_DEBUGF(PING_DEBUG, ("ping: drop\n")); + } + } + #endif /* LWIP_IPV4 */ + } + fromlen = sizeof(from); + } + + if (len == 0) { + LWIP_DEBUGF(PING_DEBUG, ("ping: recv - %"U32_F " ms - timeout\n", (sys_now() - ping_time))); + } + + /* do some ping result processing */ + PING_RESULT(0); +} + +static void +ping_thread(void *arg) { + int s; + int ret; + + #if LWIP_SO_SNDRCVTIMEO_NONSTANDARD + int timeout = PING_RCV_TIMEO; + #else + struct timeval timeout; + timeout.tv_sec = PING_RCV_TIMEO / 1000; + timeout.tv_usec = (PING_RCV_TIMEO % 1000) * 1000; + #endif + LWIP_UNUSED_ARG(arg); + + #if LWIP_IPV6 + if (IP_IS_V4(ping_target) || ip6_addr_isipv4mappedipv6(ip_2_ip6(ping_target))) { + s = lwip_socket(AF_INET6, SOCK_RAW, IP_PROTO_ICMP); + } else { + s = lwip_socket(AF_INET6, SOCK_RAW, IP6_NEXTH_ICMP6); + } + #else + s = lwip_socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP); + #endif + if (s < 0) { + return; + } + + ret = lwip_setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); + LWIP_ASSERT("setting receive timeout failed", ret == 0); + LWIP_UNUSED_ARG(ret); + + while (1) { + if (ping_send(s, ping_target) == ERR_OK) { + LWIP_DEBUGF(PING_DEBUG, ("ping: send ")); + ip_addr_debug_print(PING_DEBUG, ping_target); + LWIP_DEBUGF(PING_DEBUG, ("\n")); + + #ifdef LWIP_DEBUG + ping_time = sys_now(); + #endif /* LWIP_DEBUG */ + ping_recv(s); + } else { + LWIP_DEBUGF(PING_DEBUG, ("ping: send ")); + ip_addr_debug_print(PING_DEBUG, ping_target); + LWIP_DEBUGF(PING_DEBUG, (" - error\n")); + } + sys_msleep(PING_DELAY); + } +} + +#else /* PING_USE_SOCKETS */ + +/* Ping using the raw ip */ +static u8_t +ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) { + struct icmp_echo_hdr *iecho; + LWIP_UNUSED_ARG(arg); + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(addr); + LWIP_ASSERT("p != NULL", p != NULL); + + if ((p->tot_len >= (PBUF_IP_HLEN + sizeof(struct icmp_echo_hdr))) && + pbuf_remove_header(p, PBUF_IP_HLEN) == 0) { + iecho = (struct icmp_echo_hdr *)p->payload; + + if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) { + LWIP_DEBUGF(PING_DEBUG, ("ping: recv ")); + ip_addr_debug_print(PING_DEBUG, addr); + LWIP_DEBUGF(PING_DEBUG, (" %"U32_F " ms\n", (sys_now() - ping_time))); + + /* do some ping result processing */ + PING_RESULT(1); + pbuf_free(p); + return 1; /* eat the packet */ + } + /* not eaten, restore original packet */ + pbuf_add_header(p, PBUF_IP_HLEN); + } + + return 0; /* don't eat the packet */ +} + +int +ping_send(struct raw_pcb *raw, const ip_addr_t *addr) { + struct pbuf *p; + struct icmp_echo_hdr *iecho; + size_t ping_size = sizeof(struct icmp_echo_hdr) + PING_DATA_SIZE; + + LWIP_DEBUGF(PING_DEBUG, ("ping: send ")); + ip_addr_debug_print(PING_DEBUG, addr); + LWIP_DEBUGF(PING_DEBUG, ("\n")); + LWIP_ASSERT("ping_size <= 0xffff", ping_size <= 0xffff); + + p = pbuf_alloc(PBUF_IP, (u16_t)ping_size, PBUF_RAM); + if (!p) { + return 0; + } + if ((p->len == p->tot_len) && (p->next == NULL)) { + iecho = (struct icmp_echo_hdr *)p->payload; + + ping_prepare_echo(iecho, (u16_t)ping_size); + + raw_sendto(raw, p, addr); + #ifdef LWIP_DEBUG + ping_time = sys_now(); + #endif /* LWIP_DEBUG */ + } + pbuf_free(p); + return 1; +} + +static void +ping_timeout(void *arg) { + struct raw_pcb *pcb = (struct raw_pcb *)arg; + + LWIP_ASSERT("ping_timeout: no pcb given!", pcb != NULL); + + ping_send(pcb, ping_target); + + sys_timeout(PING_DELAY, ping_timeout, pcb); +} + +static void +ping_raw_init(void) { + if (ping_pcb) { + return; + } + ping_pcb = raw_new(IP_PROTO_ICMP); + LWIP_ASSERT("ping_pcb != NULL", ping_pcb != NULL); + + raw_recv(ping_pcb, ping_recv, NULL); + raw_bind(ping_pcb, IP_ADDR_ANY); + sys_timeout(PING_DELAY, ping_timeout, ping_pcb); +} + +#endif /* PING_USE_SOCKETS */ + +void +ping_init(const ip_addr_t *ping_addr) { + ping_target = ping_addr; + + #if PING_USE_SOCKETS + sys_thread_new("ping_thread", ping_thread, NULL, DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO); + #else /* PING_USE_SOCKETS */ + ping_raw_init(); + #endif /* PING_USE_SOCKETS */ +} + +#endif /* LWIP_RAW */ diff --git a/ports/raspberrypi/lwip_src/ping.h b/ports/raspberrypi/lwip_src/ping.h new file mode 100644 index 0000000000..abbae9d086 --- /dev/null +++ b/ports/raspberrypi/lwip_src/ping.h @@ -0,0 +1,25 @@ +#ifndef LWIP_PING_H +#define LWIP_PING_H + +#include "lwip/raw.h" +#include "lwip/ip_addr.h" +#include "lwip/prot/icmp.h" + +/** + * PING_USE_SOCKETS: Set to 1 to use sockets, otherwise the raw api is used + */ +#ifndef PING_USE_SOCKETS +#define PING_USE_SOCKETS LWIP_SOCKET +#endif + +void ping_init(const ip_addr_t *ping_addr); +void ping_prepare_echo(struct icmp_echo_hdr *iecho, u16_t len); + +extern u16_t ping_seq_num; +#if !PING_USE_SOCKETS +void ping_set_target(const ip_addr_t *ping_addr); +int ping_send(struct raw_pcb *raw, const ip_addr_t *addr); +// u8_t ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr); +#endif /* !PING_USE_SOCKETS */ + +#endif /* LWIP_PING_H */ From 2cd5d4f5a542d77f117c01b3398daa6f21180b39 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 14 Nov 2022 15:10:28 -0600 Subject: [PATCH 103/357] allow setting root_group on Display --- shared-bindings/displayio/Display.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 512969eb20..15b5c4c4fa 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -423,8 +423,24 @@ STATIC mp_obj_t displayio_display_obj_get_root_group(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_root_group_obj, displayio_display_obj_get_root_group); -MP_PROPERTY_GETTER(displayio_display_root_group_obj, - (mp_obj_t)&displayio_display_get_root_group_obj); +STATIC mp_obj_t displayio_display_obj_set_root_group(mp_obj_t self_in, mp_obj_t group_in) { + displayio_display_obj_t *self = native_display(self_in); + displayio_group_t *group = NULL; + if (group_in != mp_const_none) { + group = MP_OBJ_TO_PTR(native_group(group_in)); + } + + bool ok = common_hal_displayio_display_show(self, group); + if (!ok) { + mp_raise_ValueError(translate("Group already used")); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_set_root_group_obj, displayio_display_obj_set_root_group); + +MP_PROPERTY_GETSET(displayio_display_root_group_obj, +(mp_obj_t)&displayio_display_get_root_group_obj, +(mp_obj_t)&displayio_display_set_root_group_obj); //| def fill_row(self, y: int, buffer: WriteableBuffer) -> WriteableBuffer: From 1329fe998ca30c2d6ae0790224f4be3197807208 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 14 Nov 2022 15:33:55 -0600 Subject: [PATCH 104/357] add to .h and format code --- shared-bindings/displayio/Display.c | 4 ++-- shared-bindings/displayio/Display.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 15b5c4c4fa..b472ec6aa4 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -439,8 +439,8 @@ STATIC mp_obj_t displayio_display_obj_set_root_group(mp_obj_t self_in, mp_obj_t MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_set_root_group_obj, displayio_display_obj_set_root_group); MP_PROPERTY_GETSET(displayio_display_root_group_obj, -(mp_obj_t)&displayio_display_get_root_group_obj, -(mp_obj_t)&displayio_display_set_root_group_obj); + (mp_obj_t)&displayio_display_get_root_group_obj, + (mp_obj_t)&displayio_display_set_root_group_obj); //| def fill_row(self, y: int, buffer: WriteableBuffer) -> WriteableBuffer: diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index 35ba0d479a..35f23ae40f 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -67,5 +67,6 @@ bool common_hal_displayio_display_set_brightness(displayio_display_obj_t *self, mp_obj_t common_hal_displayio_display_get_bus(displayio_display_obj_t *self); mp_obj_t common_hal_displayio_display_get_root_group(displayio_display_obj_t *self); +mp_obj_t common_hal_displayio_display_set_root_group(displayio_display_obj_t *self, displayio_group_t *root_group); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_DISPLAY_H From 6954e569b74ab934e0d247056a7503ec9f0720e2 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Tue, 15 Nov 2022 00:05:01 +0200 Subject: [PATCH 105/357] since it ain't leaving.. --- ports/raspberrypi/common-hal/wifi/Radio.c | 11 +---------- ports/raspberrypi/lwip_src/ping.h | 8 ++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 4f32fad793..2a74c16e0a 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -50,14 +50,7 @@ #include "lwip/dns.h" #include "lwip/icmp.h" #include "lwip/raw.h" - -#ifndef PING_ID -#define PING_ID 0xAFAF -#endif - -#ifndef PING_DEBUG -#define PING_DEBUG LWIP_DBG_ON -#endif +#include "lwip_src/ping.h" #define MAC_ADDRESS_LENGTH 6 @@ -299,8 +292,6 @@ void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv } volatile bool ping_received; -int ping_send(struct raw_pcb *raw, const ip_addr_t *addr); -uint16_t ping_seq_num; uint32_t ping_time; static u8_t diff --git a/ports/raspberrypi/lwip_src/ping.h b/ports/raspberrypi/lwip_src/ping.h index abbae9d086..1a02e2450c 100644 --- a/ports/raspberrypi/lwip_src/ping.h +++ b/ports/raspberrypi/lwip_src/ping.h @@ -12,6 +12,14 @@ #define PING_USE_SOCKETS LWIP_SOCKET #endif +#ifndef PING_ID +#define PING_ID 0xAFAF +#endif + +#ifndef PING_DEBUG +#define PING_DEBUG LWIP_DBG_ON +#endif + void ping_init(const ip_addr_t *ping_addr); void ping_prepare_echo(struct icmp_echo_hdr *iecho, u16_t len); From 63ad2b763e376808a1338c01d17e3b32c0a53830 Mon Sep 17 00:00:00 2001 From: hexthat Date: Mon, 14 Nov 2022 17:35:06 +0000 Subject: [PATCH 106/357] Translated using Weblate (Chinese (Pinyin)) Currently translated at 99.6% (992 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 51 ++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index bee1c4d4b4..664b38d57c 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-11-14 15:47+0000\n" -"Last-Translator: River Wang \n" +"PO-Revision-Date: 2022-11-14 22:15+0000\n" +"Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" "MIME-Version: 1.0\n" @@ -127,7 +127,7 @@ msgstr "%q chūshǐhuà shībài" #: shared-bindings/dualbank/__init__.c msgid "%q is %q" -msgstr "" +msgstr "%q shì %q" #: py/argcheck.c msgid "%q length must be %d" @@ -173,6 +173,7 @@ msgstr "%q bìxū >= %d" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +"%q bì xū shì zì jié shù zǔ huò lèi xíng wéi 'h', 'H', 'b', huò 'B' de shù zǔ" #: py/argcheck.c msgid "%q must be a string" @@ -597,7 +598,7 @@ msgstr "RX hé TX dōu xū yào liúliàng kòngzhì" #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "Both buttons were pressed at start up.\n" -msgstr "" +msgstr "qǐ dòng shí àn xià le liǎng gè àn niǔ.\n" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -667,7 +668,7 @@ msgstr "Zǒngxiàn yǐnjiǎo %d yǐjīng zài shǐyòng zhōng" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "Button A was pressed at start up.\n" -msgstr "" +msgstr "qǐ dòng shí àn xià àn niǔ A.\n" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -947,15 +948,15 @@ msgstr "cuò wù: bǎng dìng shī bài" #: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" -msgstr "Yùqí %q" +msgstr "Yù qí %q" #: ports/raspberrypi/bindings/cyw43/__init__.c msgid "Expected a %q or %q" -msgstr "" +msgstr "yù qī wéi %q huò %q" #: shared-bindings/alarm/__init__.c msgid "Expected an %q" -msgstr "" +msgstr "yù qī wéi %q" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1037,16 +1038,16 @@ msgstr "guò lǜ qì tài fù zá" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is duplicate" -msgstr "" +msgstr "gù jiàn chóng fù" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is invalid" -msgstr "" +msgstr "gù jiàn wú xiào" #: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" -msgstr "" +msgstr "gù jiàn tài dà" #: shared-bindings/bitmaptools/__init__.c msgid "For L8 colorspace, input bitmap must have 8 bits per pixel" @@ -1664,7 +1665,7 @@ msgstr "" #: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." -msgstr "" +msgstr "zài shēn dù shuì mián zhōng zhǐ néng shè zhì yí gè %q." #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c @@ -2025,7 +2026,7 @@ msgstr "Wēndù dòu qǔ chāoshí" #: supervisor/shared/safe_mode.c msgid "The BOOT button was pressed at start up.\n" -msgstr "" +msgstr "qǐ dòng shí àn xià le yǐn dǎo àn niǔ.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2037,11 +2038,11 @@ msgstr "" #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "The SW38 button was pressed at start up.\n" -msgstr "" +msgstr "qǐ dòng shí àn xià le SW38 àn niǔ .\n" #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "The VOLUME button was pressed at start up.\n" -msgstr "" +msgstr "qǐ dòng shí àn xià yīn liàng àn niǔ.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -2053,11 +2054,11 @@ msgstr "" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" -msgstr "" +msgstr "qǐ dòng shí àn xià zhōng yāng àn niǔ.\n" #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "The left button was pressed at start up.\n" -msgstr "" +msgstr "qǐ dòng shí àn xià zuǒ àn niǔ.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" @@ -2126,6 +2127,8 @@ msgstr "Chāoshí shíjiān tài zhǎng: Zuìdà chāoshí shíjiān wèi%d miǎ #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without requesting safe mode." msgstr "" +"yào tuì chū, qǐng zài bù qǐng qiú ān quán mó shì de qíng kuàng xià chóng zhì " +"zhǔ bǎn." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample" @@ -2246,7 +2249,7 @@ msgstr "wú fǎ qǐ dòng mDNS chá xún" #: shared-bindings/coproc/CoprocMemory.c msgid "Unable to write" -msgstr "" +msgstr "wú fǎ xiě rù" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2313,7 +2316,7 @@ msgstr "wèi zhī de xì tǒng gù jiàn cuò wù: %d" #: ports/raspberrypi/common-hal/wifi/__init__.c #, c-format msgid "Unkown error code %d" -msgstr "" +msgstr "wèi zhī cuò wù dài %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #, c-format @@ -2990,6 +2993,8 @@ msgid "" "esp32_camera.Camera requires reserved PSRAM to be configured. See the " "documentation for instructions." msgstr "" +"esp32_camera. shè xiàng jī xū yào pèi zhì yù liú de PSRAM. yǒu guān shuō " +"míng, qǐng cān yuè wén dàng." #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -3770,11 +3775,11 @@ msgstr "Jǐn zhīchí wèi shēndù = 16" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only mono is supported" -msgstr "" +msgstr "jǐn zhī chí dān shēng dào" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only oversample=64 is supported" -msgstr "" +msgstr "jǐn zhī chí guò cǎi yàng =64" #: ports/nrf/common-hal/audiobusio/PDMIn.c #: ports/stm/common-hal/audiobusio/PDMIn.c @@ -4245,7 +4250,7 @@ msgstr "wèizhī lèixíng '%q'" #: py/objstr.c #, c-format msgid "unmatched '%c' in format" -msgstr "" +msgstr "gé shì bù pǐ pèi de '%c'" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4326,7 +4331,7 @@ msgstr "wèi qǐ yòng WIFI" #: ports/raspberrypi/common-hal/wifi/Monitor.c msgid "wifi.Monitor not available" -msgstr "" +msgstr "wú xiàn wǎng luò xiǎn shì qì bù kě yòng" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From ce22a3293dc00befad9304d8208d3b71e7aa7a86 Mon Sep 17 00:00:00 2001 From: River Wang Date: Mon, 14 Nov 2022 15:47:43 +0000 Subject: [PATCH 107/357] Translated using Weblate (Chinese (Pinyin)) Currently translated at 99.6% (992 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 664b38d57c..bb20f1ef6e 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -8,7 +8,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2022-11-14 22:15+0000\n" -"Last-Translator: hexthat \n" +"Last-Translator: River Wang \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" "MIME-Version: 1.0\n" @@ -747,7 +747,7 @@ msgstr "Nín wúfǎ sǎomiáo kuòzhǎn de, kě liánjiē de guǎnggào." #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." -msgstr "wú fǎ lā dòng jǐn shū rù yǐn jiǎo." +msgstr "wúfǎ lādòng jǐn shūrù yǐnjiǎo." #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" From 2d08473ee078625b5f6249c54bbbee266e9edafe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 14 Nov 2022 21:18:40 -0600 Subject: [PATCH 108/357] this version actually saves more code space on cortex-m0 with -Os (samd21s) --- shared-module/adafruit_pixelbuf/PixelBuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index e0c63306f9..5cbda5da96 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -198,10 +198,10 @@ STATIC color_u _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t col } STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, color_u rgbw) { - int r = rgbw.r; - int g = rgbw.g; - int b = rgbw.b; - int w = rgbw.w; + uint8_t r = rgbw.r; + uint8_t g = rgbw.g; + uint8_t b = rgbw.b; + uint8_t w = rgbw.w; // DotStars don't have white, instead they have 5 bit brightness so pack it into w. Shift right // by three to leave the top five bits. if (self->bytes_per_pixel == 4 && self->byteorder.is_dotstar) { From 14ba5a75a3b03d6d5c1d6c4ea556d14dfc81b0f8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 14 Nov 2022 21:25:33 -0600 Subject: [PATCH 109/357] skip converting from long int if long ints aren't enabled .. saves 20 bytes on proxlight trinkey --- shared-module/adafruit_pixelbuf/PixelBuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index 5cbda5da96..5017ba2f2c 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -143,8 +143,10 @@ void common_hal_adafruit_pixelbuf_pixelbuf_set_brightness(mp_obj_t self_in, mp_f STATIC uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { if (mp_obj_is_small_int(obj)) { return MP_OBJ_SMALL_INT_VALUE(obj); + #if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE } else if (mp_obj_is_int(obj)) { return mp_obj_get_int_truncated(obj); + #endif } else if (mp_obj_is_float(obj)) { return (uint8_t)mp_obj_get_float(obj); } From a4dd1b2341cd777932279e58f702455c3257a481 Mon Sep 17 00:00:00 2001 From: River Wang Date: Tue, 15 Nov 2022 02:16:43 +0000 Subject: [PATCH 110/357] Translated using Weblate (Chinese (Pinyin)) Currently translated at 99.4% (990 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index bb20f1ef6e..9178bd4caa 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-11-14 22:15+0000\n" +"PO-Revision-Date: 2022-11-15 04:35+0000\n" "Last-Translator: River Wang \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -755,7 +755,7 @@ msgstr "Wúfǎ jìlù dào wénjiàn" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when visible via USB." -msgstr "tōng guò USB kě jiàn shí wú fǎ chóng xīn ān zhuāng '/'." +msgstr "tōngguò USB kějiàn shí wúfǎ chóngxīn ānzhuāng '/'." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c @@ -774,31 +774,31 @@ msgstr "Dāng fāngxiàng wéi shūrù shí, bùnéng shèzhì zhí." #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "wú fǎ zài RS485 mó shì xià zhǐ dìng RTS huò CTS" +msgstr "wúfǎ zài RS485 móshì xià zhǐdìng RTS huò CTS" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "bùnéng zi lèi huà qiēpiàn" +msgstr "bùnéng zǐlèihuà qiēpiàn" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins" -msgstr "méiyǒu MOSI hé MISO yǐn jiǎo wúfǎ chuánshū" +msgstr "méiyǒu MOSI hé MISO yǐnjiǎo, wúfǎ chuánshū" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "Wúfǎ gēnggǎi yǐ zài shǐyòng de jìshí qì shàng de pínlǜ" +msgstr "Wúfǎ zài shǐyòng zhōng de jìshí qì shàng gēnggǎi pínlǜ" #: ports/nrf/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge, only level" -msgstr "wúfǎ zài yǐn jiǎo biānyuán huànxǐng, zhǐ néng diàn píng" +msgstr "wúfǎ shǐyòng biānyuán huànxǐng, zhǐnéng shǐyòng diànpíng" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." -msgstr "wú fǎ zài yǐn jiǎo biān yuán huàn xǐng. jǐn jí bié." +msgstr "wúfǎ shǐyòng biānyuán huànxǐng. zhǐnéng shǐyòng diànpíng" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "Wèi tígōng zìfú huǎncún xiě rù" +msgstr "Wèi tígōng zìfú huǎncún xiěrù" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" @@ -810,11 +810,11 @@ msgstr "CircuitPython wúfǎ fēnpèi duī." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "Shízhōng shēnzhǎn tài zhǎng" +msgstr "shízhōng yánzhǎn guòcháng" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" -msgstr "Shǐyòng shízhōng dānwèi" +msgstr "shízhōng dānyuán zhèngzài shǐyòng zhōng" #: shared-bindings/_bleio/Connection.c msgid "" @@ -832,7 +832,7 @@ msgstr "wúfǎ jiǎnsuǒ shízhōng" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "wú fǎ shè zhì dì zhǐ" +msgstr "wúfǎ shèzhì dìzhǐ" #: shared-bindings/pwmio/PWMOut.c msgid "Could not start PWM" @@ -844,11 +844,11 @@ msgstr "Wúfǎ qǐdòng zhōngduàn,RX máng" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "Zhǎo bù dào jiěmǎ qì" +msgstr "wúfǎ fēnpèi jiěmǎ qì" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "Zhuìhuǐ. Shūrù HardFault_Handler." +msgstr "gu4zhang4, jin4ru4 HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" @@ -860,10 +860,11 @@ msgstr "DAC shèbèi chūshǐhuà cuòwù" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "Fā yuán huì yǐjīng shǐyòng" +msgstr "DAC zhèngzài bèi shǐyòng" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#, fuzzy msgid "Data 0 pin must be byte aligned" msgstr "Shùjù 0 de yǐn jiǎo bìxū shì zì jié duìqí" @@ -873,6 +874,7 @@ msgstr "Shùjù kuài bìxū zūnxún fmt qū kuài" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c +#, fuzzy msgid "Data not supported with directed advertising" msgstr "bù zhī chí dìng xiàng guǎng gào de shù jù" From ca84d79809a4835d1d5d00fa59f6fed880b6f591 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Tue, 15 Nov 2022 23:06:36 +0000 Subject: [PATCH 111/357] Allow duplicate VID and PID in CI check. --- tools/ci_check_duplicate_usb_vid_pid.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index a75bd2b3f8..4e5c48c90d 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -60,6 +60,7 @@ DEFAULT_CLUSTERLIST = { "espressif_esp32s2_devkitc_1_n4r2", "espressif_esp32s2_devkitc_1_n8r2", ], + "0x239A:0x102E": ["weact_studio_pico", "weact_studio_pico_16mb"], } cli_parser = argparse.ArgumentParser( From 93ee54a2fb52bf20c49e9dfc846e03f400322ec5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 15 Nov 2022 16:14:31 -0800 Subject: [PATCH 112/357] Fix PWM status LED never_reset It doesn't need never reset because the status LED is only active when user code isn't. This also fixes PWM never reset on espressif so that deinit will undo it. Fixes #6223 --- ports/espressif/common-hal/pwmio/PWMOut.c | 18 +++++++++++++++++- supervisor/shared/status_leds.c | 18 +++--------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ports/espressif/common-hal/pwmio/PWMOut.c b/ports/espressif/common-hal/pwmio/PWMOut.c index d83ce6590a..161f547480 100644 --- a/ports/espressif/common-hal/pwmio/PWMOut.c +++ b/ports/espressif/common-hal/pwmio/PWMOut.c @@ -166,7 +166,20 @@ void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { never_reset_tim[self->tim_handle.timer_num] = false; - never_reset_chan[self->chan_handle.channel] = false; + // Search if any other channel is using the timer and is never reset. + // Otherwise, we clear never_reset for the timer as well. + bool other_never_reset = false; + for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++) { + if (i != self->tim_handle.timer_num && + reserved_channels[i] == self->tim_handle.timer_num && + never_reset_chan[i]) { + other_never_reset = true; + break; + } + } + if (!other_never_reset) { + never_reset_chan[self->chan_handle.channel] = false; + } } bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t *self) { @@ -182,11 +195,13 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { ledc_stop(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, 0); } reserved_channels[self->chan_handle.channel] = INDEX_EMPTY; + never_reset_chan[self->chan_handle.channel] = false; // Search if any other channel is using the timer bool taken = false; for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++) { if (reserved_channels[i] == self->tim_handle.timer_num) { taken = true; + break; } } // Variable frequency means there's only one channel on the timer @@ -195,6 +210,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { reserved_timer_freq[self->tim_handle.timer_num] = 0; // if timer isn't varfreq this will be off aleady varfreq_timers[self->tim_handle.timer_num] = false; + never_reset_tim[self->tim_handle.timer_num] = false; } common_hal_reset_pin(self->pin); self->deinited = true; diff --git a/supervisor/shared/status_leds.c b/supervisor/shared/status_leds.c index 315e64a9a0..7e6c7983b1 100644 --- a/supervisor/shared/status_leds.c +++ b/supervisor/shared/status_leds.c @@ -179,27 +179,15 @@ void status_led_init() { #elif CIRCUITPY_PWM_RGB_LED if (common_hal_mcu_pin_is_free(CIRCUITPY_RGB_STATUS_R)) { - pwmout_result_t red_result = common_hal_pwmio_pwmout_construct(&rgb_status_r, CIRCUITPY_RGB_STATUS_R, 0, 50000, false); - - if (PWMOUT_OK == red_result) { - common_hal_pwmio_pwmout_never_reset(&rgb_status_r); - } + common_hal_pwmio_pwmout_construct(&rgb_status_r, CIRCUITPY_RGB_STATUS_R, 0, 50000, false); } if (common_hal_mcu_pin_is_free(CIRCUITPY_RGB_STATUS_G)) { - pwmout_result_t green_result = common_hal_pwmio_pwmout_construct(&rgb_status_g, CIRCUITPY_RGB_STATUS_G, 0, 50000, false); - - if (PWMOUT_OK == green_result) { - common_hal_pwmio_pwmout_never_reset(&rgb_status_g); - } + common_hal_pwmio_pwmout_construct(&rgb_status_g, CIRCUITPY_RGB_STATUS_G, 0, 50000, false); } if (common_hal_mcu_pin_is_free(CIRCUITPY_RGB_STATUS_B)) { - pwmout_result_t blue_result = common_hal_pwmio_pwmout_construct(&rgb_status_b, CIRCUITPY_RGB_STATUS_B, 0, 50000, false); - - if (PWMOUT_OK == blue_result) { - common_hal_pwmio_pwmout_never_reset(&rgb_status_b); - } + common_hal_pwmio_pwmout_construct(&rgb_status_b, CIRCUITPY_RGB_STATUS_B, 0, 50000, false); } #elif defined(MICROPY_HW_LED_STATUS) From 5b64a62c1629e793f10a61acfa330857de1cce86 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 15 Nov 2022 18:37:23 -0600 Subject: [PATCH 113/357] move hidden declare inside struct --- shared-module/vectorio/VectorShape.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/vectorio/VectorShape.h b/shared-module/vectorio/VectorShape.h index ce5823e40c..6ce09f9308 100644 --- a/shared-module/vectorio/VectorShape.h +++ b/shared-module/vectorio/VectorShape.h @@ -30,7 +30,6 @@ typedef struct { mp_obj_t pixel_shader; int16_t x; int16_t y; - bool hidden : 1; displayio_buffer_transform_t *absolute_transform; // Tracks current shape footprint and expands outward as the shape dirties and changes. // This is suboptimal if you move your shape far. Could add more state to only redraw @@ -38,6 +37,7 @@ typedef struct { displayio_area_t ephemeral_dirty_area; displayio_area_t current_area; bool current_area_dirty; + bool hidden; } vectorio_vector_shape_t; displayio_area_t *vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_t *self, displayio_area_t *tail); From 8e4e84c58b337eadfa1cd764011786d7c540e187 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 15 Nov 2022 16:51:47 -0800 Subject: [PATCH 114/357] Match channel number, not timer number --- ports/espressif/common-hal/pwmio/PWMOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/pwmio/PWMOut.c b/ports/espressif/common-hal/pwmio/PWMOut.c index 161f547480..68518fbd25 100644 --- a/ports/espressif/common-hal/pwmio/PWMOut.c +++ b/ports/espressif/common-hal/pwmio/PWMOut.c @@ -170,7 +170,7 @@ void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { // Otherwise, we clear never_reset for the timer as well. bool other_never_reset = false; for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++) { - if (i != self->tim_handle.timer_num && + if (i != self->chan_handle.channel && reserved_channels[i] == self->tim_handle.timer_num && never_reset_chan[i]) { other_never_reset = true; From 788638f7279e540b21d6f0c08d75a8dc3e00b36d Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 15 Nov 2022 19:15:25 -0600 Subject: [PATCH 115/357] displayio.SERIAL_GROUP constant --- shared-bindings/displayio/__init__.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 80fcde6e49..8e8a59347c 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -45,6 +45,7 @@ #endif #include "shared-bindings/displayio/Shape.h" #include "shared-bindings/displayio/TileGrid.h" +#include "shared-module/displayio/__init__.h" //| """Native helpers for driving displays //| @@ -95,6 +96,7 @@ STATIC const mp_rom_map_elem_t displayio_module_globals_table[] = { #endif { MP_ROM_QSTR(MP_QSTR_release_displays), MP_ROM_PTR(&displayio_release_displays_obj) }, + { MP_ROM_QSTR(MP_QSTR_SERIAL_GROUP), MP_ROM_PTR(&circuitpython_splash) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_module_globals, displayio_module_globals_table); From b74893eb07fdbe9fed2b17749c4f66ee664ff153 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 15 Nov 2022 21:52:12 -0500 Subject: [PATCH 116/357] samd21: port_disable_tick() should disable event channel --- ports/atmel-samd/supervisor/port.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 424acece78..2c63e28a17 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -644,6 +644,10 @@ void port_disable_tick(void) { RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2; #endif #ifdef SAMD21 + if (_tick_event_channel == EVSYS_SYNCH_NUM) { + return; + } + if (_tick_event_channel >= 8) { uint8_t value = 1 << (_tick_event_channel - 8); EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVDp8(value); @@ -651,6 +655,7 @@ void port_disable_tick(void) { uint8_t value = 1 << _tick_event_channel; EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVD(value); } + disable_event_channel(_tick_event_channel); _tick_event_channel = EVSYS_SYNCH_NUM; #endif } From b0d0fcbabc7162533110162d9f03c38321ed9f6a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 17 Nov 2022 10:31:36 -0600 Subject: [PATCH 117/357] supervisor_start_terminal: don't crash if display is tiny Closes: #7222 --- supervisor/shared/display.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 8ed2f5c17e..0a066e8016 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -74,11 +74,8 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { scale = 1; } - width_in_tiles = width_px / (scroll_area->tile_width * scale); - if (width_in_tiles < 1) { - width_in_tiles = 1; - } - uint16_t height_in_tiles = height_px / (scroll_area->tile_height * scale); + width_in_tiles = MAX(1, width_px / (scroll_area->tile_width * scale)); + uint16_t height_in_tiles = MAX(2, height_px / (scroll_area->tile_height * scale)); uint16_t total_tiles = width_in_tiles * height_in_tiles; @@ -117,7 +114,6 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { status_bar->top_left_y = 0; status_bar->width_in_tiles = width_in_tiles; status_bar->height_in_tiles = 1; - assert(width_in_tiles > 0); status_bar->pixel_width = width_in_tiles * status_bar->tile_width; status_bar->pixel_height = status_bar->tile_height; status_bar->tiles = tiles; @@ -127,8 +123,6 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { scroll_area->top_left_y = 0; scroll_area->width_in_tiles = width_in_tiles; scroll_area->height_in_tiles = height_in_tiles - 1; - assert(width_in_tiles > 0); - assert(height_in_tiles > 1); scroll_area->pixel_width = width_in_tiles * scroll_area->tile_width; scroll_area->pixel_height = (height_in_tiles - 1) * scroll_area->tile_height; #if CIRCUITPY_REPL_LOGO From f9f1edbb08215d90ec99614596131d5705510837 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Fri, 1 Apr 2022 12:39:20 +0200 Subject: [PATCH 118/357] setup PWM status LED on aithinker ESP32-C3 boards --- .../espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h | 4 +++- ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h index a42f8b0436..a9f0075a41 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h +++ b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h @@ -30,7 +30,9 @@ #define MICROPY_HW_MCU_NAME "ESP32-C3" // Status LED -#define MICROPY_HW_LED_STATUS (&pin_GPIO19) +#define CIRCUITPY_RGB_STATUS_R (&pin_GPIO3) +#define CIRCUITPY_RGB_STATUS_G (&pin_GPIO4) +#define CIRCUITPY_RGB_STATUS_B (&pin_GPIO5) // Default bus pins #define DEFAULT_UART_BUS_RX (&pin_GPIO20) diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h index 20fb1ff022..f3f89d500b 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h +++ b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h @@ -30,7 +30,9 @@ #define MICROPY_HW_MCU_NAME "ESP32-C3FN4" // Status LED -#define MICROPY_HW_LED_STATUS (&pin_GPIO19) +#define CIRCUITPY_RGB_STATUS_R (&pin_GPIO3) +#define CIRCUITPY_RGB_STATUS_G (&pin_GPIO4) +#define CIRCUITPY_RGB_STATUS_B (&pin_GPIO5) // Default bus pins #define DEFAULT_UART_BUS_RX (&pin_GPIO20) From b8cd6c093fa25ba650a79a64ce83491607f80691 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Thu, 17 Nov 2022 21:47:39 +0200 Subject: [PATCH 119/357] picow-ap progress --- locale/circuitpython.pot | 18 ++++++++-- ports/raspberrypi/common-hal/wifi/Radio.c | 40 ++++++++++++++++++----- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 044900bd30..2d759d8cbe 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -106,7 +106,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -171,7 +171,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -397,6 +397,10 @@ msgstr "" msgid "ADC2 is being used by WiFi" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "AP cannot be stopped." +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -478,10 +482,18 @@ msgstr "" msgid "Already advertising." msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Already connected to station." +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Already in access point mode." +msgstr "" + #: ports/espressif/common-hal/coproc/__init__.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -3153,7 +3165,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index b70543a43c..ea0cde78bc 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -155,12 +155,11 @@ void common_hal_wifi_radio_start_station(wifi_radio_obj_t *self) { } void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) { + + // This is wrong This is fine. cyw43_wifi_leave(&cyw43_state, CYW43_ITF_STA); - // This is wrong, but without this call the state of ITF_STA is still - // reported as CYW43_LINK_JOIN (by wifi_link_status) and CYW43_LINK_UP - // (by tcpip_link_status). Until AP support is added, we can ignore the - // problem. cyw43_wifi_leave(&cyw43_state, CYW43_ITF_AP); + bindings_cyw43_wifi_enforce_pm(); } @@ -168,21 +167,41 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ if (!common_hal_wifi_radio_get_enabled(self)) { mp_raise_RuntimeError(translate("wifi is not enabled")); } - // Is there a better way? - common_hal_wifi_radio_stop_station(self); + + if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_STA) != CYW43_LINK_DOWN) { + mp_raise_RuntimeError(translate("Already connected to station.")); + } + + common_hal_wifi_radio_stop_ap(self); // Channel can only be changed after inital powerup and config of ap. // Defaults to 1 if not set or invalid (i.e. 13) cyw43_wifi_ap_set_channel(&cyw43_state, (const uint32_t)channel); cyw43_arch_enable_ap_mode((const char *)ssid, (const char *)password, CYW43_AUTH_WPA2_AES_PSK); + // TODO: Implement authmode check like in espressif bindings_cyw43_wifi_enforce_pm(); } void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self) { - common_hal_wifi_radio_stop_station(self); - // I mean, since it already does both.. + if (!common_hal_wifi_radio_get_enabled(self)) { + mp_raise_RuntimeError(translate("wifi is not enabled")); + } + + if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_AP) != CYW43_LINK_DOWN) { + mp_raise_NotImplementedError(translate("AP cannot be stopped.")); + } + + /* + * AP cannot be disconnected. cyw43_wifi_leave is broken. + * This code snippet should work, but doesn't. + * + * cyw43_wifi_leave(&cyw43_state, CYW43_ITF_AP); + * cyw43_wifi_leave(&cyw43_state, CYW43_ITF_STA); + * + * bindings_cyw43_wifi_enforce_pm(); + */ } wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len) { @@ -190,6 +209,11 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t mp_raise_RuntimeError(translate("wifi is not enabled")); } + if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_AP) != CYW43_LINK_DOWN) { + mp_raise_RuntimeError(translate("Already in access point mode.")); + } + + size_t timeout_ms = timeout <= 0 ? 8000 : (size_t)MICROPY_FLOAT_C_FUN(ceil)(timeout * 1000); uint64_t start = port_get_raw_ticks(NULL); uint64_t deadline = start + timeout_ms; From e2a359726351cd18ecaaf13c6adaca2091abb2ee Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Fri, 18 Nov 2022 11:27:23 +0530 Subject: [PATCH 120/357] add awesome new make error message Copied from initial implementation on atmel-samd Co-authored-by: Rose Hooper Co-authored-by: Jeff Epler --- ports/broadcom/Makefile | 13 ++++++++++--- ports/cxd56/Makefile | 13 +++++++++++-- ports/espressif/Makefile | 13 +++++++++++-- ports/litex/Makefile | 13 +++++++++++-- ports/mimxrt10xx/Makefile | 13 +++++++++++-- ports/nrf/Makefile | 16 +++++++++++----- ports/raspberrypi/Makefile | 13 +++++++++++-- ports/stm/Makefile | 17 +++++++++++++---- 8 files changed, 89 insertions(+), 22 deletions(-) diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index 757e7f3450..ca516958e0 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -1,11 +1,18 @@ # Select the board to build for. -BOARD?=raspberrypi_pi4b +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD "$(BOARD)" specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 073d2d59ce..208d3222b0 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -23,11 +23,20 @@ # THE SOFTWARE. # Select the board to build for. +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef + ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 30c35f9caf..331e443561 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -23,11 +23,20 @@ # THE SOFTWARE. # Select the board to build for. +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef + ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 6b1e33c8d1..3281977657 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -23,11 +23,20 @@ # THE SOFTWARE. # Select the board to build for. +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef + ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 4b05c91714..2dda646882 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -24,11 +24,20 @@ # THE SOFTWARE. # Select the board to build for. +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef + ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index bbe102ffc8..2dbc582022 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -23,14 +23,20 @@ # THE SOFTWARE. # Select the board to build for. +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef + ifeq ($(BOARD),) - $(info You must provide a BOARD parameter with 'BOARD=') - $(info Possible values are:) - $(info $(sort $(subst /.,,$(subst boards/,,$(wildcard boards/*/.))))) - $(error BOARD not defined) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 5095c4c1f8..151c60ba1b 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -23,11 +23,20 @@ # THE SOFTWARE. # Select the board to build for. +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef + ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif diff --git a/ports/stm/Makefile b/ports/stm/Makefile index afde51bdc0..ac373cbbfa 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -24,12 +24,21 @@ # THE SOFTWARE. # Select the board to build for. +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef + ifeq ($(BOARD),) -$(error You must provide a BOARD parameter) + $(info No BOARD specified) + $(call show_board_error) else -ifeq ($(wildcard boards/$(BOARD)/.),) -$(error Invalid BOARD specified) -endif + ifeq ($(wildcard boards/$(BOARD)/.),) + $(info Invalid BOARD specified) + $(call show_board_error) + endif endif # If the build directory is not given, make it reflect the board name. From c3c1717813808563b9a5f3cd6072d93eb7ba401e Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Fri, 18 Nov 2022 23:00:28 +0530 Subject: [PATCH 121/357] refactor common port specific Makefile code --- ports/atmel-samd/Makefile | 40 +--------------------- ports/broadcom/Makefile | 62 +++++++++++++-------------------- ports/cxd56/Makefile | 43 +---------------------- ports/espressif/Makefile | 46 +------------------------ ports/litex/Makefile | 41 +--------------------- ports/mimxrt10xx/Makefile | 40 +--------------------- ports/nrf/Makefile | 45 +++--------------------- ports/raspberrypi/Makefile | 40 +--------------------- ports/stm/Makefile | 41 +--------------------- py/circuitpy_mkenv.mk | 70 ++++++++++++++++++++++++++++++++++++++ 10 files changed, 106 insertions(+), 362 deletions(-) create mode 100644 py/circuitpy_mkenv.mk diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index d27a048399..fdfb6c81b8 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -22,45 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef - -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk -# Port-specific -include mpconfigport.mk -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk +include ../../py/circuitpy_mkenv.mk CROSS_COMPILE = arm-none-eabi- diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index ca516958e0..cbd072e833 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -1,42 +1,28 @@ -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef +# This file is part of the MicroPython project, http://micropython.org/ +# +# The MIT License (MIT) +# +# SPDX-FileCopyrightText: Copyright (c) 2020 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. -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk -# Port-specific -include mpconfigport.mk -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk +include ../../py/circuitpy_mkenv.mk ifeq ($(CHIP_VARIANT), "bcm2711") CFLAGS += -mcpu=cortex-a72 -DBCM_VERSION=2711 diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 208d3222b0..389b8a7fe6 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -22,48 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef - -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk - -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk - -# Port-specific -include mpconfigport.mk - -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk +include ../../py/circuitpy_mkenv.mk CROSS_COMPILE = arm-none-eabi- diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 331e443561..b197195aa2 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -22,51 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef - -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -# If the flash PORT is not given, use the default /dev/tty.SLAB_USBtoUART. -PORT ?= /dev/tty.SLAB_USBtoUART - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk - -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk - -# Port-specific -include mpconfigport.mk - -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk +include ../../py/circuitpy_mkenv.mk ifeq ($(IDF_TARGET),esp32c3) IDF_TARGET_ARCH = riscv diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 3281977657..1c5c0a014e 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -22,46 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef - -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk -# Port-specific -include mpconfigport.mk - -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk +include ../../py/circuitpy_mkenv.mk CROSS_COMPILE = riscv64-unknown-elf- diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 2dda646882..1c5c62bb85 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -23,45 +23,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef - -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk -# Port-specific -include mpconfigport.mk -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk +include ../../py/circuitpy_mkenv.mk CROSS_COMPILE = arm-none-eabi- diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 2dbc582022..22cfd474ce 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -22,51 +22,16 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef +include ../../py/circuitpy_mkenv.mk -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -CLI_SD := $(SD) SD_LOWER = $(shell echo $(SD) | tr '[:upper:]' '[:lower:]') -# Build directory with SD if it's different from the default. -BUILD ?= $(if $(CLI_SD),build-$(BOARD)-$(SD_LOWER),build-$(BOARD)) - -include ../../py/mkenv.mk -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk -# Port-specific -include mpconfigport.mk -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk - ifneq ($(SD), ) include bluetooth/bluetooth_common.mk + ifeq ($(BUILD), build-$(BOARD)) + # Build directory with SD if it's different from the default. + BUILD = build-$(BOARD)-$(SD_LOWER) + endif endif CROSS_COMPILE = arm-none-eabi- diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 151c60ba1b..06408e25c6 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -22,45 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef - -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk -# Port-specific -include mpconfigport.mk -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk +include ../../py/circuitpy_mkenv.mk CROSS_COMPILE = arm-none-eabi- diff --git a/ports/stm/Makefile b/ports/stm/Makefile index ac373cbbfa..726123a0ba 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -23,46 +23,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# Select the board to build for. -define show_board_error -boardlist = -$(info Valid boards:) -$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) -$(error Rerun with $(MAKE) BOARD=) -endef - -ifeq ($(BOARD),) - $(info No BOARD specified) - $(call show_board_error) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(info Invalid BOARD specified) - $(call show_board_error) - endif -endif - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk -# Port-specific -include mpconfigport.mk - -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk +include ../../py/circuitpy_mkenv.mk CROSS_COMPILE = arm-none-eabi- diff --git a/py/circuitpy_mkenv.mk b/py/circuitpy_mkenv.mk new file mode 100644 index 0000000000..d776cc2fef --- /dev/null +++ b/py/circuitpy_mkenv.mk @@ -0,0 +1,70 @@ +# This file is part of the MicroPython project, http://micropython.org/ +# +# The MIT License (MIT) +# +# SPDX-FileCopyrightText: Copyright (c) 2022 MicroDev +# +# 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. + +# Common Makefile items that can be shared across CircuitPython ports. + +# Select the board to build for. +define show_board_error +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) +endef + +ifeq ($(BOARD),) + $(info No BOARD specified) + $(call show_board_error) +else + ifeq ($(wildcard boards/$(BOARD)/.),) + $(info Invalid BOARD specified) + $(call show_board_error) + endif +endif + +# If the flash PORT is not given, use the default /dev/tty.SLAB_USBtoUART. +PORT ?= /dev/tty.SLAB_USBtoUART + +# If the build directory is not given, make it reflect the board name. +BUILD ?= build-$(BOARD) + +include ../../py/mkenv.mk + +# Board-specific +include boards/$(BOARD)/mpconfigboard.mk + +# Port-specific +include mpconfigport.mk + +# CircuitPython-specific +include $(TOP)/py/circuitpy_mpconfig.mk + +# qstr definitions (must come before including py.mk) +QSTR_DEFS = qstrdefsport.h + +# include py core make definitions +include $(TOP)/py/py.mk + +include $(TOP)/supervisor/supervisor.mk + +# Include make rules and variables common across CircuitPython builds. +include $(TOP)/py/circuitpy_defns.mk From 7c51201e88e75f351aa882a97e7395181585f8fd Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sat, 19 Nov 2022 00:18:35 +0530 Subject: [PATCH 122/357] fix nRF build directory naming --- ports/nrf/Makefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 22cfd474ce..67d2a5e685 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -24,14 +24,8 @@ include ../../py/circuitpy_mkenv.mk -SD_LOWER = $(shell echo $(SD) | tr '[:upper:]' '[:lower:]') - ifneq ($(SD), ) include bluetooth/bluetooth_common.mk - ifeq ($(BUILD), build-$(BOARD)) - # Build directory with SD if it's different from the default. - BUILD = build-$(BOARD)-$(SD_LOWER) - endif endif CROSS_COMPILE = arm-none-eabi- From 406e46f46bfadb001c38037f3f141f9037d023f6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Nov 2022 14:34:28 -0600 Subject: [PATCH 123/357] Allow serial "break" to trigger KeyboardInterrupt When the USB serial buffer is full, the Ctrl-C code to send KeyboardInterrupt can't be sent, which creates a problem if you've pasted code or otherwise filled the buffer and need to recover. A similar problem affects advanced UIs that interact with CircuitPython and may send characters when they're unexpected, such as mu when it tries to move the cursor based on the user clicking on the screen. The main way forward seems to be to use some kind of message that can still reach CircuitPython when its internal serial recieve buffer is full. RS232 defines a "break" signal, in which the transmitting device holds its data line in the "space" state for many entire character times. This still exists in the world of USB serial. This does work, sort of, except that your host computer software will need to properly handle blocking serial writes; tio can send a break with the **ctrl-c b** sequence, but this only works if it hasn't yet written too much data, so it doesn't actually help in most situations :-/ --- supervisor/shared/usb/usb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index a51c6c2659..81a4cbc332 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -359,4 +359,10 @@ void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char) { } } +void tud_cdc_send_break_cb(uint8_t itf, uint16_t duration_ms) { + if (usb_cdc_console_enabled() && mp_interrupt_char != -1 && itf == 0 && duration_ms > 0) { + mp_sched_keyboard_interrupt(); + } +} + #endif From 88bd9ef6b8207b9835d60e5c590faa04e46d4895 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Fri, 18 Nov 2022 22:51:05 +0200 Subject: [PATCH 124/357] just change the ap error --- locale/circuitpython.pot | 8 ++++---- ports/raspberrypi/common-hal/wifi/Radio.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 2d759d8cbe..c91b425ef5 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -397,10 +397,6 @@ msgstr "" msgid "ADC2 is being used by WiFi" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c -msgid "AP cannot be stopped." -msgstr "" - #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1979,6 +1975,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index ea0cde78bc..a3a8f8ec12 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -190,7 +190,7 @@ void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self) { } if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_AP) != CYW43_LINK_DOWN) { - mp_raise_NotImplementedError(translate("AP cannot be stopped.")); + mp_raise_NotImplementedError(translate("Stopping AP is not supported.")); } /* From afca4cef6dd4daa8ff3c82b4c235b9d60300c67d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Nov 2022 16:05:46 -0600 Subject: [PATCH 125/357] This code can only be active if USB CDC is enabled. --- supervisor/shared/usb/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 81a4cbc332..fa85cddb83 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -341,7 +341,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ #endif // CIRCUITPY_USB_VENDOR -#if MICROPY_KBD_EXCEPTION +#if MICROPY_KBD_EXCEPTION && CIRCUITPY_USB_CDC /** * Callback invoked when received an "wanted" char. From 403e3ef4309ce761ef0465c58d9b5c038da01851 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 18 Nov 2022 16:53:18 -0600 Subject: [PATCH 126/357] change to CIRCUITPYTHON_TERMINAL. change internal API to use set_root_group --- shared-bindings/displayio/Display.c | 5 +---- shared-bindings/displayio/__init__.c | 2 +- shared-module/displayio/Display.c | 10 +++++++++- shared-module/displayio/EPaperDisplay.c | 2 +- shared-module/displayio/display_core.c | 2 +- shared-module/displayio/display_core.h | 2 +- shared-module/framebufferio/FramebufferDisplay.c | 2 +- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index b472ec6aa4..e5a2836d1a 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -430,10 +430,7 @@ STATIC mp_obj_t displayio_display_obj_set_root_group(mp_obj_t self_in, mp_obj_t group = MP_OBJ_TO_PTR(native_group(group_in)); } - bool ok = common_hal_displayio_display_show(self, group); - if (!ok) { - mp_raise_ValueError(translate("Group already used")); - } + common_hal_displayio_display_set_root_group(self, group); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_set_root_group_obj, displayio_display_obj_set_root_group); diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 8e8a59347c..3fcd1d082b 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -96,7 +96,7 @@ STATIC const mp_rom_map_elem_t displayio_module_globals_table[] = { #endif { MP_ROM_QSTR(MP_QSTR_release_displays), MP_ROM_PTR(&displayio_release_displays_obj) }, - { MP_ROM_QSTR(MP_QSTR_SERIAL_GROUP), MP_ROM_PTR(&circuitpython_splash) }, + { MP_ROM_QSTR(MP_QSTR_CIRCUITPYTHON_TERMINAL), MP_ROM_PTR(&circuitpython_splash) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_module_globals, displayio_module_globals_table); diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 9fd55fe19d..2d65e88836 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -141,7 +141,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, } bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group) { - return displayio_display_core_show(&self->core, root_group); + return displayio_display_core_set_root_group(&self->core, root_group); } uint16_t common_hal_displayio_display_get_width(displayio_display_obj_t *self) { @@ -398,6 +398,14 @@ void common_hal_displayio_display_set_auto_refresh(displayio_display_obj_t *self self->auto_refresh = auto_refresh; } +mp_obj_t common_hal_displayio_display_set_root_group(displayio_display_obj_t *self, displayio_group_t *root_group) { + bool ok = displayio_display_core_set_root_group(&self->core, root_group); + if (!ok) { + mp_raise_ValueError(translate("Group already used")); + } + return mp_const_none; +} + void displayio_display_background(displayio_display_obj_t *self) { if (self->auto_refresh && (supervisor_ticks_ms64() - self->core.last_refresh) > self->native_ms_per_frame) { _refresh_display(self); diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 0010d88d12..c8378e53dd 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -103,7 +103,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t } bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group) { - return displayio_display_core_show(&self->core, root_group); + return displayio_display_core_set_root_group(&self->core, root_group); } STATIC const displayio_area_t *displayio_epaperdisplay_get_refresh_areas(displayio_epaperdisplay_obj_t *self) { diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 8b2f0bfdf8..eadb0ebd4c 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -162,7 +162,7 @@ void displayio_display_core_set_rotation(displayio_display_core_t *self, } } -bool displayio_display_core_show(displayio_display_core_t *self, displayio_group_t *root_group) { +bool displayio_display_core_set_root_group(displayio_display_core_t *self, displayio_group_t *root_group) { if (root_group == NULL) { // set the display to the REPL, reset REPL position and size circuitpython_splash.in_group = false; diff --git a/shared-module/displayio/display_core.h b/shared-module/displayio/display_core.h index 8c2ba21b5e..2167683a0d 100644 --- a/shared-module/displayio/display_core.h +++ b/shared-module/displayio/display_core.h @@ -61,7 +61,7 @@ void displayio_display_core_construct(displayio_display_core_t *self, mp_obj_t bus, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word); -bool displayio_display_core_show(displayio_display_core_t *self, displayio_group_t *root_group); +bool displayio_display_core_set_root_group(displayio_display_core_t *self, displayio_group_t *root_group); uint16_t displayio_display_core_get_width(displayio_display_core_t *self); uint16_t displayio_display_core_get_height(displayio_display_core_t *self); diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index e2e7d11106..79cb09ab39 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -102,7 +102,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu } bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t *self, displayio_group_t *root_group) { - return displayio_display_core_show(&self->core, root_group); + return displayio_display_core_set_root_group(&self->core, root_group); } uint16_t common_hal_framebufferio_framebufferdisplay_get_width(framebufferio_framebufferdisplay_obj_t *self) { From 1611cf98dab67d90c987a261f1b804e33b94ca68 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 18 Nov 2022 18:27:38 -0500 Subject: [PATCH 127/357] have clock start high in SPI mode 3 --- ports/raspberrypi/common-hal/busio/SPI.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/raspberrypi/common-hal/busio/SPI.c b/ports/raspberrypi/common-hal/busio/SPI.c index a7b97823f9..67323790bf 100644 --- a/ports/raspberrypi/common-hal/busio/SPI.c +++ b/ports/raspberrypi/common-hal/busio/SPI.c @@ -151,6 +151,15 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, spi_set_format(self->peripheral, bits, polarity, phase, SPI_MSB_FIRST); + // Workaround to start with clock line high if polarity=1. The hw SPI peripheral does not do this + // automatically. See https://github.com/raspberrypi/pico-sdk/issues/868 and + // https://forums.raspberrypi.com/viewtopic.php?t=336142 + // TODO: scheduled to be be fixed in pico-sdk 1.5.0. + if (polarity) { + hw_clear_bits(&spi_get_hw(self->peripheral)->cr1, SPI_SSPCR1_SSE_BITS); // disable the SPI + hw_set_bits(&spi_get_hw(self->peripheral)->cr1, SPI_SSPCR1_SSE_BITS); // re-enable the SPI + } + self->polarity = polarity; self->phase = phase; self->bits = bits; From e3cae2229790528fb1167bf7898aa7acd17bc82e Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 18 Nov 2022 17:34:03 -0600 Subject: [PATCH 128/357] allow set_root_group for EPaperDisplay instead of show() --- shared-bindings/displayio/EPaperDisplay.c | 25 +++++++++++++++++++++++ shared-bindings/displayio/EPaperDisplay.h | 3 +++ shared-module/displayio/EPaperDisplay.c | 7 +++++++ 3 files changed, 35 insertions(+) diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 7b77b42fa4..f3831b5084 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -349,6 +349,30 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_bus_obj, displayio_epaperd MP_PROPERTY_GETTER(displayio_epaperdisplay_bus_obj, (mp_obj_t)&displayio_epaperdisplay_get_bus_obj); +//| root_group: Group +//| """The root group on the epaper display.""" +//| +STATIC mp_obj_t displayio_epaperdisplay_obj_get_root_group(mp_obj_t self_in) { + displayio_epaperdisplay_obj_t *self = native_display(self_in); + return common_hal_displayio_epaperdisplay_get_root_group(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_root_group_obj, displayio_epaperdisplay_obj_get_root_group); + +STATIC mp_obj_t displayio_epaperdisplay_obj_set_root_group(mp_obj_t self_in, mp_obj_t group_in) { + displayio_epaperdisplay_obj_t *self = native_display(self_in); + displayio_group_t *group = NULL; + if (group_in != mp_const_none) { + group = MP_OBJ_TO_PTR(native_group(group_in)); + } + + common_hal_displayio_epaperdisplay_set_root_group(self, group); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_set_root_group_obj, displayio_epaperdisplay_obj_set_root_group); + +MP_PROPERTY_GETSET(displayio_epaperdisplay_root_group_obj, + (mp_obj_t)&displayio_epaperdisplay_get_root_group_obj, + (mp_obj_t)&displayio_epaperdisplay_set_root_group_obj); STATIC const mp_rom_map_elem_t displayio_epaperdisplay_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&displayio_epaperdisplay_show_obj) }, @@ -361,6 +385,7 @@ STATIC const mp_rom_map_elem_t displayio_epaperdisplay_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_bus), MP_ROM_PTR(&displayio_epaperdisplay_bus_obj) }, { MP_ROM_QSTR(MP_QSTR_busy), MP_ROM_PTR(&displayio_epaperdisplay_busy_obj) }, { MP_ROM_QSTR(MP_QSTR_time_to_refresh), MP_ROM_PTR(&displayio_epaperdisplay_time_to_refresh_obj) }, + { MP_ROM_QSTR(MP_QSTR_root_group), MP_ROM_PTR(&displayio_epaperdisplay_root_group_obj) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_epaperdisplay_locals_dict, displayio_epaperdisplay_locals_dict_table); diff --git a/shared-bindings/displayio/EPaperDisplay.h b/shared-bindings/displayio/EPaperDisplay.h index ba6dffcb4b..13fd51d132 100644 --- a/shared-bindings/displayio/EPaperDisplay.h +++ b/shared-bindings/displayio/EPaperDisplay.h @@ -48,6 +48,9 @@ bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t *s bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group); +mp_obj_t common_hal_displayio_epaperdisplay_get_root_group(displayio_epaperdisplay_obj_t *self); +bool common_hal_displayio_epaperdisplay_set_root_group(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group); + // Returns time in milliseconds. uint32_t common_hal_displayio_epaperdisplay_get_time_to_refresh(displayio_epaperdisplay_obj_t *self); bool common_hal_displayio_epaperdisplay_get_busy(displayio_epaperdisplay_obj_t *self); diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index c8378e53dd..68464d50ea 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -106,6 +106,10 @@ bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t *self return displayio_display_core_set_root_group(&self->core, root_group); } +bool common_hal_displayio_epaperdisplay_set_root_group(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group) { + return displayio_display_core_set_root_group(&self->core, root_group); +} + STATIC const displayio_area_t *displayio_epaperdisplay_get_refresh_areas(displayio_epaperdisplay_obj_t *self) { if (self->core.full_refresh) { self->core.area.next = NULL; @@ -239,6 +243,9 @@ uint16_t common_hal_displayio_epaperdisplay_get_rotation(displayio_epaperdisplay return self->core.rotation; } +mp_obj_t common_hal_displayio_epaperdisplay_get_root_group(displayio_epaperdisplay_obj_t *self) { + return self->core.current_group; +} STATIC bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t *self, const displayio_area_t *area) { uint16_t buffer_size = 128; // In uint32_ts From e4f5ca11f9439e6aafb3e3063c47b13086e50636 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sat, 19 Nov 2022 10:45:10 +0530 Subject: [PATCH 129/357] compare against pr head commit instead of merge ref --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e540f3aa3..607717f5fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -141,6 +141,7 @@ jobs: uses: tj-actions/changed-files@v34 with: json: "true" + sha: ${{ steps.get-last-commit-with-checks.outputs.commit && github.event.after }} base_sha: ${{ steps.get-last-commit-with-checks.outputs.commit }} - name: Set matrix id: set-matrix From 4e0f8e7fcd9cb65bd4583ece41bea6fc7277c3c4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 19 Nov 2022 10:50:12 -0600 Subject: [PATCH 130/357] Interrupt on UART 'break' Tested and working with the CH9102F USB converter on Adafruit's Feather ESP32 V2 (& tio as the software on the host computer) Closes: #7233 --- ports/espressif/common-hal/busio/UART.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index cdaf25250f..f025c15b3e 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -49,8 +49,9 @@ static void uart_event_task(void *param) { while (true) { if (xQueueReceive(self->event_queue, &event, portMAX_DELAY)) { switch (event.type) { + case UART_BREAK: case UART_PATTERN_DET: - // When the console uart receives CTRL+C, wake the main task and schedule a keyboard interrupt + // When the console uart receives CTRL+C or BREAK, wake the main task and schedule a keyboard interrupt if (self->is_console) { port_wake_main_task(); if (mp_interrupt_char == CHAR_CTRL_C) { From ef3398422a88f72cf5863e768f6a5f705d1ffb9e Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 19 Nov 2022 11:41:48 -0600 Subject: [PATCH 131/357] allow set_root_group for FrameBufferDisplay instead of show() --- .../framebufferio/FramebufferDisplay.c | 20 +++++++++++++++++-- .../framebufferio/FramebufferDisplay.h | 1 + .../framebufferio/FramebufferDisplay.c | 8 ++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 20e555eef9..51124984bf 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -328,8 +328,24 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_root_group(mp_obj_t sel } MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_root_group_obj, framebufferio_framebufferdisplay_obj_get_root_group); -MP_PROPERTY_GETTER(framebufferio_framebufferdisplay_root_group_obj, - (mp_obj_t)&framebufferio_framebufferdisplay_get_root_group_obj); +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_root_group(mp_obj_t self_in, mp_obj_t group_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + displayio_group_t *group = NULL; + if (group_in != mp_const_none) { + group = MP_OBJ_TO_PTR(native_group(group_in)); + } + + bool ok = common_hal_framebufferio_framebufferdisplay_set_root_group(self, group); + if (!ok) { + mp_raise_ValueError(translate("Group already used")); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_root_group_obj, framebufferio_framebufferdisplay_obj_set_root_group); + +MP_PROPERTY_GETSET(framebufferio_framebufferdisplay_root_group_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_root_group_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_set_root_group_obj); STATIC const mp_rom_map_elem_t framebufferio_framebufferdisplay_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&framebufferio_framebufferdisplay_show_obj) }, diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h index 7c63587df7..6526e25afb 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.h +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -61,5 +61,6 @@ bool common_hal_framebufferio_framebufferdisplay_set_brightness(framebufferio_fr mp_obj_t common_hal_framebufferio_framebufferdisplay_framebuffer(framebufferio_framebufferdisplay_obj_t *self); mp_obj_t common_hal_framebufferio_framebufferdisplay_get_root_group(framebufferio_framebufferdisplay_obj_t *self); +mp_obj_t common_hal_framebufferio_framebufferdisplay_set_root_group(framebufferio_framebufferdisplay_obj_t *self, displayio_group_t *root_group); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_FRAMEBUFFERDISPLAY_H diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 79cb09ab39..7575523166 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -362,3 +362,11 @@ void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj mp_obj_t common_hal_framebufferio_framebufferdisplay_get_root_group(framebufferio_framebufferdisplay_obj_t *self) { return self->core.current_group; } + +mp_obj_t common_hal_framebufferio_framebufferdisplay_set_root_group(framebufferio_framebufferdisplay_obj_t *self, displayio_group_t *root_group) { + bool ok = displayio_display_core_set_root_group(&self->core, root_group); + if (!ok) { + mp_raise_ValueError(translate("Group already used")); + } + return mp_const_none; +} From 7ea563e661cedaa6714b003f08801097277938fe Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sat, 19 Nov 2022 23:29:05 +0530 Subject: [PATCH 132/357] fix json parse issue --- .github/workflows/build.yml | 4 ++-- tools/ci_set_matrix.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 607717f5fe..8863664232 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,14 +140,14 @@ jobs: if: github.event_name == 'pull_request' uses: tj-actions/changed-files@v34 with: - json: "true" + json: true sha: ${{ steps.get-last-commit-with-checks.outputs.commit && github.event.after }} base_sha: ${{ steps.get-last-commit-with-checks.outputs.commit }} - name: Set matrix id: set-matrix working-directory: tools env: - CHANGED_FILES: ${{ toJSON(steps.get-changes.outputs.all_changed_and_modified_files) }} + CHANGED_FILES: ${{ steps.get-changes.outputs.all_changed_and_modified_files }} LAST_FAILED_JOBS: ${{ steps.get-last-commit-with-checks.outputs.checkruns }} run: python3 -u ci_set_matrix.py diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index 081cf8d4fa..aeb24b9931 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -69,7 +69,7 @@ else: changed_files = [] else: print("Using files list in CHANGED_FILES") - changed_files = json.loads(c) + changed_files = json.loads(c.replace("\\", "")) j = os.environ["LAST_FAILED_JOBS"] if j == "": @@ -203,7 +203,7 @@ def set_boards_to_build(build_all): # Split boards by architecture. print("Building boards:") arch_to_boards = {"aarch": [], "arm": [], "riscv": [], "espressif": []} - for board in boards_to_build: + for board in sorted(boards_to_build): print(" ", board) port = board_to_port.get(board) # A board can appear due to its _deletion_ (rare) @@ -220,6 +220,7 @@ def set_boards_to_build(build_all): failed_boards = last_failed_jobs[f"build-{arch}"] for board in failed_boards: if not board in arch_to_boards[arch]: + print(" ", board) arch_to_boards[arch].append(board) # Set Output set_output(f"boards-{arch}", json.dumps(sorted(arch_to_boards[arch]))) From 4856f42f84316910e49701adf263bb7d09680bd9 Mon Sep 17 00:00:00 2001 From: hexthat Date: Fri, 18 Nov 2022 18:28:23 +0000 Subject: [PATCH 133/357] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (995 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9178bd4caa..408b785287 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-11-15 04:35+0000\n" -"Last-Translator: River Wang \n" +"PO-Revision-Date: 2022-11-19 18:48+0000\n" +"Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" "MIME-Version: 1.0\n" @@ -72,7 +72,7 @@ msgstr "%%c xūyào zhěngshù huòzhě zìfú" #: main.c #, c-format msgid "%02X" -msgstr "" +msgstr "%02X" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -741,9 +741,8 @@ msgid "Cannot get temperature" msgstr "Wúfǎ huòqǔ wēndù" #: shared-bindings/_bleio/Adapter.c -#, fuzzy msgid "Cannot have scan responses for extended, connectable advertisements." -msgstr "Nín wúfǎ sǎomiáo kuòzhǎn de, kě liánjiē de guǎnggào." +msgstr "Quē fá duì tuī guǎng, kě lián jiē guǎng gào de dá fù." #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." @@ -794,7 +793,7 @@ msgstr "wúfǎ shǐyòng biānyuán huànxǐng, zhǐnéng shǐyòng diànpíng" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." -msgstr "wúfǎ shǐyòng biānyuán huànxǐng. zhǐnéng shǐyòng diànpíng" +msgstr "wúfǎ shǐyòng biānyuán huànxǐng. zhǐnéng shǐyòng diànpíng." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -864,9 +863,8 @@ msgstr "DAC zhèngzài bèi shǐyòng" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/nrf/common-hal/paralleldisplay/ParallelBus.c -#, fuzzy msgid "Data 0 pin must be byte aligned" -msgstr "Shùjù 0 de yǐn jiǎo bìxū shì zì jié duìqí" +msgstr "shù jù 0 yǐn jiǎo bì xū shì zì jié duì qí de" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" @@ -874,9 +872,8 @@ msgstr "Shùjù kuài bìxū zūnxún fmt qū kuài" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy msgid "Data not supported with directed advertising" -msgstr "bù zhī chí dìng xiàng guǎng gào de shù jù" +msgstr "wèi xiàng guǎng gào tí gòng zhī zhù de shù jù" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -2186,7 +2183,7 @@ msgstr "UART xiě rù" #: main.c msgid "UID:" -msgstr "" +msgstr "UID:" #: shared-module/usb_hid/Device.c msgid "USB busy" From 40d35e9eaa764335cbac1f71134914df313ec1eb Mon Sep 17 00:00:00 2001 From: s-ol Date: Sun, 20 Nov 2022 16:08:00 +0100 Subject: [PATCH 134/357] Don't block in I2CTarget.request(-1) Partially reverts #6985 Closes #7241 --- shared-bindings/i2ctarget/I2CTarget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/i2ctarget/I2CTarget.c b/shared-bindings/i2ctarget/I2CTarget.c index 4dc5b775f4..17da952118 100644 --- a/shared-bindings/i2ctarget/I2CTarget.c +++ b/shared-bindings/i2ctarget/I2CTarget.c @@ -159,7 +159,7 @@ STATIC mp_obj_t i2ctarget_i2c_target_request(size_t n_args, const mp_obj_t *pos_ bool forever = false; uint64_t timeout_end = 0; - if (timeout_ms <= 0) { + if (timeout_ms == 0) { forever = true; } else if (timeout_ms > 0) { timeout_end = common_hal_time_monotonic_ms() + timeout_ms; From 85a83b8150182f3b9b19addbaa92ed774acdc8ca Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 21 Nov 2022 12:35:10 -0500 Subject: [PATCH 135/357] Simplify some ESP32-C3 board sdkconfig files --- .../boards/adafruit_qtpy_esp32c3/sdkconfig | 65 ------------------- .../boards/beetle-esp32-c3/sdkconfig | 8 --- .../espressif/boards/lolin_c3_mini/sdkconfig | 8 --- .../boards/microdev_micro_c3/sdkconfig | 65 ------------------- 4 files changed, 146 deletions(-) diff --git a/ports/espressif/boards/adafruit_qtpy_esp32c3/sdkconfig b/ports/espressif/boards/adafruit_qtpy_esp32c3/sdkconfig index 5111900c7e..b47420753c 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32c3/sdkconfig +++ b/ports/espressif/boards/adafruit_qtpy_esp32c3/sdkconfig @@ -1,70 +1,5 @@ -# Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) Project Configuration -# -# Bootloader config -# -CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y -# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set -CONFIG_BOOTLOADER_LOG_LEVEL=0 -# end of Bootloader config - -# -# Serial flasher config -# -# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set -# end of Serial flasher config - -# -# Partition Table -# -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv" -CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv" -# end of Partition Table - -# -# Compiler options -# -# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set -# end of Compiler options - -# -# Component config -# -# - -# -# PHY -# -CONFIG_ESP_PHY_ENABLE_USB=y -# end of PHY - -# -# ESP System Settings -# -# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set -CONFIG_ESP_CONSOLE_SECONDARY_NONE=y -# CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG is not set -# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -# end of ESP System Settings - # # LWIP # CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-QTPy-ESP32C3" # end of LWIP - -# -# SPI Flash driver -# -# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set -# end of SPI Flash driver - -# end of Component config - -# -# Deprecated options for backward compatibility -# -# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set -CONFIG_LOG_BOOTLOADER_LEVEL=0 -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set -# end of Deprecated options for backward compatibility diff --git a/ports/espressif/boards/beetle-esp32-c3/sdkconfig b/ports/espressif/boards/beetle-esp32-c3/sdkconfig index 331a5d14dc..68be40df7a 100644 --- a/ports/espressif/boards/beetle-esp32-c3/sdkconfig +++ b/ports/espressif/boards/beetle-esp32-c3/sdkconfig @@ -1,13 +1,5 @@ -# -# PHY -# -CONFIG_ESP_PHY_ENABLE_USB=y -# end of PHY - # # LWIP # CONFIG_LWIP_LOCAL_HOSTNAME="beetle-esp32-c3 # end of LWIP - - diff --git a/ports/espressif/boards/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig index c548ee3c69..833f8368fa 100644 --- a/ports/espressif/boards/lolin_c3_mini/sdkconfig +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -1,13 +1,5 @@ -# -# PHY -# -CONFIG_ESP_PHY_ENABLE_USB=y -# end of PHY - # # LWIP # CONFIG_LWIP_LOCAL_HOSTNAME="lolin-c3-mini" # end of LWIP - - diff --git a/ports/espressif/boards/microdev_micro_c3/sdkconfig b/ports/espressif/boards/microdev_micro_c3/sdkconfig index 6674dbfb90..f6f038a77c 100644 --- a/ports/espressif/boards/microdev_micro_c3/sdkconfig +++ b/ports/espressif/boards/microdev_micro_c3/sdkconfig @@ -1,70 +1,5 @@ -# Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) Project Configuration -# -# Bootloader config -# -CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y -# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set -CONFIG_BOOTLOADER_LOG_LEVEL=0 -# end of Bootloader config - -# -# Serial flasher config -# -# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set -# end of Serial flasher config - -# -# Partition Table -# -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv" -CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv" -# end of Partition Table - -# -# Compiler options -# -# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set -# end of Compiler options - -# -# Component config -# -# - -# -# PHY -# -CONFIG_ESP_PHY_ENABLE_USB=y -# end of PHY - -# -# ESP System Settings -# -# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set -CONFIG_ESP_CONSOLE_SECONDARY_NONE=y -# CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG is not set -# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -# end of ESP System Settings - # # LWIP # CONFIG_LWIP_LOCAL_HOSTNAME="MicroDev-microC3" # end of LWIP - -# -# SPI Flash driver -# -# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set -# end of SPI Flash driver - -# end of Component config - -# -# Deprecated options for backward compatibility -# -# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set -CONFIG_LOG_BOOTLOADER_LEVEL=0 -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set -# end of Deprecated options for backward compatibility From df0150ff0ea533ccabd3c2a33bd95a2dea8a8268 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 21 Nov 2022 15:15:26 -0500 Subject: [PATCH 136/357] Add common settings to sdkconfig-esp32c3.defaults --- .../esp-idf-config/sdkconfig-esp32c3.defaults | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults index 5b5df1837c..5fdb766add 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults @@ -80,6 +80,12 @@ CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # end of Hardware Settings +# +# PHY +# +CONFIG_ESP_PHY_ENABLE_USB=y +# end of PHY + # # ESP System Settings # @@ -97,8 +103,12 @@ CONFIG_ESP_SYSTEM_MEMPROT_MEM_ALIGN_SIZE=512 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y # CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 + +CONFIG_ESP_CONSOLE_SECONDARY_NONE=y +# CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG is not set # end of ESP System Settings + # # Wi-Fi # From b40facd0b42ecfaffc5f9fb084a49b050a3bf6a2 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Tue, 22 Nov 2022 01:00:34 +0200 Subject: [PATCH 137/357] Error msg changes --- locale/circuitpython.pot | 20 ++++++++++++-------- ports/raspberrypi/common-hal/wifi/Radio.c | 10 +++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c91b425ef5..2af9257feb 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -478,18 +478,10 @@ msgstr "" msgid "Already advertising." msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c -msgid "Already connected to station." -msgstr "" - #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c -msgid "Already in access point mode." -msgstr "" - #: ports/espressif/common-hal/coproc/__init__.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -2363,6 +2355,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index a3a8f8ec12..55b9fc7b95 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -134,7 +134,7 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self, u mp_raise_RuntimeError(translate("Already scanning for wifi networks")); } if (!common_hal_wifi_radio_get_enabled(self)) { - mp_raise_RuntimeError(translate("wifi is not enabled")); + mp_raise_RuntimeError(translate("Wifi is not enabled")); } wifi_scannednetworks_obj_t *scan = m_new_obj(wifi_scannednetworks_obj_t); scan->base.type = &wifi_scannednetworks_type; @@ -165,11 +165,11 @@ void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) { void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections) { if (!common_hal_wifi_radio_get_enabled(self)) { - mp_raise_RuntimeError(translate("wifi is not enabled")); + mp_raise_RuntimeError(translate("Wifi is not enabled")); } if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_STA) != CYW43_LINK_DOWN) { - mp_raise_RuntimeError(translate("Already connected to station.")); + mp_raise_RuntimeError(translate("Wifi is in station mode.")); } common_hal_wifi_radio_stop_ap(self); @@ -206,11 +206,11 @@ void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self) { wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len) { if (!common_hal_wifi_radio_get_enabled(self)) { - mp_raise_RuntimeError(translate("wifi is not enabled")); + mp_raise_RuntimeError(translate("Wifi is not enabled")); } if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_AP) != CYW43_LINK_DOWN) { - mp_raise_RuntimeError(translate("Already in access point mode.")); + mp_raise_RuntimeError(translate("Wifi is in access point mode.")); } From c3a96a63c03ab54451437a8e289789cdf62d2dda Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 18 Nov 2022 11:21:02 -0800 Subject: [PATCH 138/357] Enable* web workflow for Pico W * Except for circuitpython.local which depends on MDNS and will be done in a follow up PR. Progress on #7214 --- ports/atmel-samd/Makefile | 1 - ports/atmel-samd/fatfs_port.c | 48 ----- ports/broadcom/Makefile | 1 - ports/broadcom/fatfs_port.c | 48 ----- ports/cxd56/Makefile | 1 - ports/cxd56/fatfs_port.c | 46 ----- ports/espressif/Makefile | 1 - .../espressif/common-hal/socketpool/Socket.c | 41 +++- ports/espressif/fatfs_port.c | 51 ----- ports/litex/Makefile | 1 - ports/litex/fatfs_port.c | 33 ---- ports/mimxrt10xx/Makefile | 1 - ports/mimxrt10xx/fatfs_port.c | 48 ----- ports/nrf/Makefile | 1 - ports/raspberrypi/Makefile | 7 +- .../raspberry_pi_pico_w/mpconfigboard.mk | 2 +- .../common-hal/socketpool/Socket.c | 179 ++++++++++++------ ports/raspberrypi/common-hal/wifi/Radio.c | 14 +- ports/raspberrypi/common-hal/wifi/Radio.h | 1 + ports/raspberrypi/fatfs_port.c | 48 ----- ports/stm/Makefile | 1 - ports/stm/fatfs_port.c | 33 ---- shared-bindings/socketpool/Socket.c | 58 +++--- shared-bindings/socketpool/Socket.h | 11 +- shared-bindings/socketpool/SocketPool.c | 24 ++- shared-bindings/socketpool/SocketPool.h | 18 +- supervisor/{fatfs_port.h => fatfs.h} | 6 +- supervisor/shared/bluetooth/file_transfer.c | 2 +- .../fatfs_port.c => supervisor/shared/fatfs.c | 5 +- supervisor/shared/web_workflow/web_workflow.c | 148 +++++++-------- supervisor/shared/web_workflow/websocket.c | 22 +-- supervisor/supervisor.mk | 1 + 32 files changed, 333 insertions(+), 569 deletions(-) delete mode 100644 ports/atmel-samd/fatfs_port.c delete mode 100644 ports/broadcom/fatfs_port.c delete mode 100644 ports/cxd56/fatfs_port.c delete mode 100644 ports/espressif/fatfs_port.c delete mode 100644 ports/litex/fatfs_port.c delete mode 100644 ports/mimxrt10xx/fatfs_port.c delete mode 100644 ports/raspberrypi/fatfs_port.c delete mode 100644 ports/stm/fatfs_port.c rename supervisor/{fatfs_port.h => fatfs.h} (89%) rename ports/nrf/fatfs_port.c => supervisor/shared/fatfs.c (94%) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 4405766d00..5ddeb07c97 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -322,7 +322,6 @@ SRC_C += \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ eic_handler.c \ - fatfs_port.c \ lib/tinyusb/src/portable/microchip/samd/dcd_samd.c \ mphalport.c \ reset.c \ diff --git a/ports/atmel-samd/fatfs_port.c b/ports/atmel-samd/fatfs_port.c deleted file mode 100644 index 58a0ef0d72..0000000000 --- a/ports/atmel-samd/fatfs_port.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George - * - * 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 "py/mphal.h" -#include "py/runtime.h" -#include "lib/oofatfs/ff.h" /* FatFs lower layer API */ -#include "lib/oofatfs/diskio.h" /* FatFs lower layer API */ -#include "shared/timeutils/timeutils.h" - -#if CIRCUITPY_RTC -#include "shared-bindings/rtc/RTC.h" -#endif - -DWORD get_fattime(void) { - #if CIRCUITPY_RTC - timeutils_struct_time_t tm; - common_hal_rtc_get_time(&tm); - return ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) | - (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1); - #else - return ((2016 - 1980) << 25) | ((9) << 21) | ((1) << 16) | ((16) << 11) | ((43) << 5) | (35 / 2); - #endif - - -} diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index 757e7f3450..1786d1d189 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -65,7 +65,6 @@ SRC_C += bindings/videocore/__init__.c \ boards/$(BOARD)/pins.c \ background.c \ common-hal/videocore/Framebuffer.c \ - fatfs_port.c \ mphalport.c \ lib/sdmmc/sdmmc_cmd.c \ lib/sdmmc/sdmmc_common.c \ diff --git a/ports/broadcom/fatfs_port.c b/ports/broadcom/fatfs_port.c deleted file mode 100644 index 58a0ef0d72..0000000000 --- a/ports/broadcom/fatfs_port.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George - * - * 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 "py/mphal.h" -#include "py/runtime.h" -#include "lib/oofatfs/ff.h" /* FatFs lower layer API */ -#include "lib/oofatfs/diskio.h" /* FatFs lower layer API */ -#include "shared/timeutils/timeutils.h" - -#if CIRCUITPY_RTC -#include "shared-bindings/rtc/RTC.h" -#endif - -DWORD get_fattime(void) { - #if CIRCUITPY_RTC - timeutils_struct_time_t tm; - common_hal_rtc_get_time(&tm); - return ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) | - (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1); - #else - return ((2016 - 1980) << 25) | ((9) << 21) | ((1) << 16) | ((16) << 11) | ((43) << 5) | (35 / 2); - #endif - - -} diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 073d2d59ce..3317b90280 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -172,7 +172,6 @@ SRC_S = supervisor/cpu.s SRC_C += \ background.c \ - fatfs_port.c \ mphalport.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ diff --git a/ports/cxd56/fatfs_port.c b/ports/cxd56/fatfs_port.c deleted file mode 100644 index e672b095b7..0000000000 --- a/ports/cxd56/fatfs_port.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2019 Sony Semiconductor Solutions Corporation - * - * 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 "py/mphal.h" -#include "py/runtime.h" -#include "lib/oofatfs/ff.h" /* FatFs lower layer API */ -#include "lib/oofatfs/diskio.h" /* FatFs lower layer API */ -#include "shared/timeutils/timeutils.h" - -#if CIRCUITPY_RTC -#include "shared-bindings/rtc/RTC.h" -#endif - -DWORD get_fattime(void) { - #if CIRCUITPY_RTC - timeutils_struct_time_t tm; - common_hal_rtc_get_time(&tm); - return ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) | - (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1); - #else - return ((2016 - 1980) << 25) | ((9) << 21) | ((1) << 16) | ((16) << 11) | ((43) << 5) | (35 / 2); - #endif -} diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 30c35f9caf..4e2ada4317 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -250,7 +250,6 @@ endif SRC_C += \ background.c \ - fatfs_port.c \ mphalport.c \ bindings/espidf/__init__.c \ boards/$(BOARD)/board.c \ diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index ce177f3821..5f34d674b2 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -240,7 +240,7 @@ socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_ return sock; } -int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port) { +int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port, socketpool_socket_obj_t *accepted) { struct sockaddr_in accept_addr; socklen_t socklen = sizeof(accept_addr); int newsoc = -1; @@ -274,12 +274,25 @@ int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_ lwip_close(newsoc); return -MP_EBADF; } + + + if (accepted != NULL) { + // Close the active socket because we have another we accepted. + if (!common_hal_socketpool_socket_get_closed(accepted)) { + common_hal_socketpool_socket_close(accepted); + } + // Create the socket + accepted->num = newsoc; + accepted->pool = self->pool; + accepted->connected = true; + } + return newsoc; } socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port) { - int newsoc = socketpool_socket_accept(self, ip, port); + int newsoc = socketpool_socket_accept(self, ip, port, NULL); if (newsoc > 0) { mark_user_socket(newsoc); @@ -554,6 +567,15 @@ void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t *self, uint self->timeout_ms = timeout_ms; } + +int common_hal_socketpool_socket_setsockopt(socketpool_socket_obj_t *self, int level, int optname, const void *value, size_t optlen) { + int err = lwip_setsockopt(self->num, level, optname, value, optlen); + if (err != 0) { + return -errno; + } + return 0; +} + bool common_hal_socketpool_readable(socketpool_socket_obj_t *self) { struct timeval immediate = {0, 0}; @@ -577,3 +599,18 @@ bool common_hal_socketpool_writable(socketpool_socket_obj_t *self) { // including returning true in the error case return num_triggered != 0; } + +void socketpool_socket_move(socketpool_socket_obj_t *self, socketpool_socket_obj_t *sock) { + *sock = *self; + self->connected = false; + self->num = -1; +} + +void socketpool_socket_reset(socketpool_socket_obj_t *self) { + if (self->base.type == &socketpool_socket_type) { + return; + } + self->base.type = &socketpool_socket_type; + self->connected = false; + self->num = -1; +} diff --git a/ports/espressif/fatfs_port.c b/ports/espressif/fatfs_port.c deleted file mode 100644 index 38c2d923b8..0000000000 --- a/ports/espressif/fatfs_port.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George - * - * 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 "py/runtime.h" -#include "lib/oofatfs/ff.h" -#include "shared/timeutils/timeutils.h" -#include "shared-bindings/rtc/RTC.h" -#include "shared-bindings/time/__init__.h" -#include "supervisor/fatfs_port.h" - -DWORD _time_override = 0; -DWORD get_fattime(void) { - if (_time_override > 0) { - return _time_override; - } - #if CIRCUITPY_RTC - timeutils_struct_time_t tm; - common_hal_rtc_get_time(&tm); - return ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) | - (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1); - #else - return ((2016 - 1980) << 25) | ((9) << 21) | ((1) << 16) | ((16) << 11) | ((43) << 5) | (35 / 2); - #endif -} - -void override_fattime(DWORD time) { - _time_override = time; -} diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 6b1e33c8d1..9e59c1a2fa 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -117,7 +117,6 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_VALENTYUSB_EPTRI -DCFG_TUD_CDC_RX_BUFSIZE=1024 SRC_C += \ background.c \ - fatfs_port.c \ mphalport.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c diff --git a/ports/litex/fatfs_port.c b/ports/litex/fatfs_port.c deleted file mode 100644 index 631f7f0982..0000000000 --- a/ports/litex/fatfs_port.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George - * - * 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 "py/runtime.h" -#include "lib/oofatfs/ff.h" - -DWORD get_fattime(void) { - // TODO: Implement this function. For now, fake it. - return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); -} diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 4b05c91714..291871f275 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -150,7 +150,6 @@ SRC_C += \ boards/$(BOARD)/board.c \ boards/$(BOARD)/flash_config.c \ boards/$(BOARD)/pins.c \ - fatfs_port.c \ lib/tinyusb/src/portable/chipidea/ci_hs/dcd_ci_hs.c \ mphalport.c \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/clocks.c \ diff --git a/ports/mimxrt10xx/fatfs_port.c b/ports/mimxrt10xx/fatfs_port.c deleted file mode 100644 index 58a0ef0d72..0000000000 --- a/ports/mimxrt10xx/fatfs_port.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George - * - * 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 "py/mphal.h" -#include "py/runtime.h" -#include "lib/oofatfs/ff.h" /* FatFs lower layer API */ -#include "lib/oofatfs/diskio.h" /* FatFs lower layer API */ -#include "shared/timeutils/timeutils.h" - -#if CIRCUITPY_RTC -#include "shared-bindings/rtc/RTC.h" -#endif - -DWORD get_fattime(void) { - #if CIRCUITPY_RTC - timeutils_struct_time_t tm; - common_hal_rtc_get_time(&tm); - return ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) | - (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1); - #else - return ((2016 - 1980) << 25) | ((9) << 21) | ((1) << 16) | ((16) << 11) | ((43) << 5) | (35 / 2); - #endif - - -} diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index bbe102ffc8..c792223a0b 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -165,7 +165,6 @@ endif SRC_C += \ background.c \ - fatfs_port.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ device/$(MCU_VARIANT)/startup_$(MCU_SUB_VARIANT).c \ diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index cb4c80a23d..9b9ae92322 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -211,13 +211,15 @@ CFLAGS += \ -msoft-float \ -mfloat-abi=soft -PICO_LDFLAGS = --specs=nosys.specs -Wl,--wrap=__aeabi_ldiv0 -Wl,--wrap=__aeabi_idiv0 -Wl,--wrap=__aeabi_lmul -Wl,--wrap=__clzsi2 -Wl,--wrap=__clzdi2 -Wl,--wrap=__ctzsi2 -Wl,--wrap=__ctzdi2 -Wl,--wrap=__popcountsi2 -Wl,--wrap=__popcountdi2 -Wl,--wrap=__clz -Wl,--wrap=__clzl -Wl,--wrap=__clzll -Wl,--wrap=__aeabi_idiv -Wl,--wrap=__aeabi_idivmod -Wl,--wrap=__aeabi_ldivmod -Wl,--wrap=__aeabi_uidiv -Wl,--wrap=__aeabi_uidivmod -Wl,--wrap=__aeabi_uldivmod -Wl,--wrap=__aeabi_dadd -Wl,--wrap=__aeabi_ddiv -Wl,--wrap=__aeabi_dmul -Wl,--wrap=__aeabi_drsub -Wl,--wrap=__aeabi_dsub -Wl,--wrap=__aeabi_cdcmpeq -Wl,--wrap=__aeabi_cdrcmple -Wl,--wrap=__aeabi_cdcmple -Wl,--wrap=__aeabi_dcmpeq -Wl,--wrap=__aeabi_dcmplt -Wl,--wrap=__aeabi_dcmple -Wl,--wrap=__aeabi_dcmpge -Wl,--wrap=__aeabi_dcmpgt -Wl,--wrap=__aeabi_dcmpun -Wl,--wrap=__aeabi_i2d -Wl,--wrap=__aeabi_l2d -Wl,--wrap=__aeabi_ui2d -Wl,--wrap=__aeabi_ul2d -Wl,--wrap=__aeabi_d2iz -Wl,--wrap=__aeabi_d2lz -Wl,--wrap=__aeabi_d2uiz -Wl,--wrap=__aeabi_d2ulz -Wl,--wrap=__aeabi_d2f -Wl,--wrap=sqrt -Wl,--wrap=cos -Wl,--wrap=sin -Wl,--wrap=tan -Wl,--wrap=atan2 -Wl,--wrap=exp -Wl,--wrap=log -Wl,--wrap=ldexp -Wl,--wrap=copysign -Wl,--wrap=trunc -Wl,--wrap=floor -Wl,--wrap=ceil -Wl,--wrap=round -Wl,--wrap=sincos -Wl,--wrap=asin -Wl,--wrap=acos -Wl,--wrap=atan -Wl,--wrap=sinh -Wl,--wrap=cosh -Wl,--wrap=tanh -Wl,--wrap=asinh -Wl,--wrap=acosh -Wl,--wrap=atanh -Wl,--wrap=exp2 -Wl,--wrap=log2 -Wl,--wrap=exp10 -Wl,--wrap=log10 -Wl,--wrap=pow -Wl,--wrap=powint -Wl,--wrap=hypot -Wl,--wrap=cbrt -Wl,--wrap=fmod -Wl,--wrap=drem -Wl,--wrap=remainder -Wl,--wrap=remquo -Wl,--wrap=expm1 -Wl,--wrap=log1p -Wl,--wrap=fma -Wl,--wrap=__aeabi_fadd -Wl,--wrap=__aeabi_fdiv -Wl,--wrap=__aeabi_fmul -Wl,--wrap=__aeabi_frsub -Wl,--wrap=__aeabi_fsub -Wl,--wrap=__aeabi_cfcmpeq -Wl,--wrap=__aeabi_cfrcmple -Wl,--wrap=__aeabi_cfcmple -Wl,--wrap=__aeabi_fcmpeq -Wl,--wrap=__aeabi_fcmplt -Wl,--wrap=__aeabi_fcmple -Wl,--wrap=__aeabi_fcmpge -Wl,--wrap=__aeabi_fcmpgt -Wl,--wrap=__aeabi_fcmpun -Wl,--wrap=__aeabi_i2f -Wl,--wrap=__aeabi_l2f -Wl,--wrap=__aeabi_ui2f -Wl,--wrap=__aeabi_ul2f -Wl,--wrap=__aeabi_f2iz -Wl,--wrap=__aeabi_f2lz -Wl,--wrap=__aeabi_f2uiz -Wl,--wrap=__aeabi_f2ulz -Wl,--wrap=__aeabi_f2d -Wl,--wrap=sqrtf -Wl,--wrap=cosf -Wl,--wrap=sinf -Wl,--wrap=tanf -Wl,--wrap=atan2f -Wl,--wrap=expf -Wl,--wrap=logf -Wl,--wrap=ldexpf -Wl,--wrap=copysignf -Wl,--wrap=truncf -Wl,--wrap=floorf -Wl,--wrap=ceilf -Wl,--wrap=roundf -Wl,--wrap=sincosf -Wl,--wrap=asinf -Wl,--wrap=acosf -Wl,--wrap=atanf -Wl,--wrap=sinhf -Wl,--wrap=coshf -Wl,--wrap=tanhf -Wl,--wrap=asinhf -Wl,--wrap=acoshf -Wl,--wrap=atanhf -Wl,--wrap=exp2f -Wl,--wrap=log2f -Wl,--wrap=exp10f -Wl,--wrap=log10f -Wl,--wrap=powf -Wl,--wrap=powintf -Wl,--wrap=hypotf -Wl,--wrap=cbrtf -Wl,--wrap=fmodf -Wl,--wrap=dremf -Wl,--wrap=remainderf -Wl,--wrap=remquof -Wl,--wrap=expm1f -Wl,--wrap=log1pf -Wl,--wrap=fmaf -Wl,--wrap=memcpy -Wl,--wrap=memset -Wl,--wrap=__aeabi_memcpy -Wl,--wrap=__aeabi_memset -Wl,--wrap=__aeabi_memcpy4 -Wl,--wrap=__aeabi_memset4 -Wl,--wrap=__aeabi_memcpy8 -Wl,--wrap=__aeabi_memset8 +PICO_LDFLAGS = --specs=nosys.specs --specs=nano.specs -Wl,--wrap=__aeabi_ldiv0 -Wl,--wrap=__aeabi_idiv0 -Wl,--wrap=__aeabi_lmul -Wl,--wrap=__clzsi2 -Wl,--wrap=__clzdi2 -Wl,--wrap=__ctzsi2 -Wl,--wrap=__ctzdi2 -Wl,--wrap=__popcountsi2 -Wl,--wrap=__popcountdi2 -Wl,--wrap=__clz -Wl,--wrap=__clzl -Wl,--wrap=__clzll -Wl,--wrap=__aeabi_idiv -Wl,--wrap=__aeabi_idivmod -Wl,--wrap=__aeabi_ldivmod -Wl,--wrap=__aeabi_uidiv -Wl,--wrap=__aeabi_uidivmod -Wl,--wrap=__aeabi_uldivmod -Wl,--wrap=__aeabi_dadd -Wl,--wrap=__aeabi_ddiv -Wl,--wrap=__aeabi_dmul -Wl,--wrap=__aeabi_drsub -Wl,--wrap=__aeabi_dsub -Wl,--wrap=__aeabi_cdcmpeq -Wl,--wrap=__aeabi_cdrcmple -Wl,--wrap=__aeabi_cdcmple -Wl,--wrap=__aeabi_dcmpeq -Wl,--wrap=__aeabi_dcmplt -Wl,--wrap=__aeabi_dcmple -Wl,--wrap=__aeabi_dcmpge -Wl,--wrap=__aeabi_dcmpgt -Wl,--wrap=__aeabi_dcmpun -Wl,--wrap=__aeabi_i2d -Wl,--wrap=__aeabi_l2d -Wl,--wrap=__aeabi_ui2d -Wl,--wrap=__aeabi_ul2d -Wl,--wrap=__aeabi_d2iz -Wl,--wrap=__aeabi_d2lz -Wl,--wrap=__aeabi_d2uiz -Wl,--wrap=__aeabi_d2ulz -Wl,--wrap=__aeabi_d2f -Wl,--wrap=sqrt -Wl,--wrap=cos -Wl,--wrap=sin -Wl,--wrap=tan -Wl,--wrap=atan2 -Wl,--wrap=exp -Wl,--wrap=log -Wl,--wrap=ldexp -Wl,--wrap=copysign -Wl,--wrap=trunc -Wl,--wrap=floor -Wl,--wrap=ceil -Wl,--wrap=round -Wl,--wrap=sincos -Wl,--wrap=asin -Wl,--wrap=acos -Wl,--wrap=atan -Wl,--wrap=sinh -Wl,--wrap=cosh -Wl,--wrap=tanh -Wl,--wrap=asinh -Wl,--wrap=acosh -Wl,--wrap=atanh -Wl,--wrap=exp2 -Wl,--wrap=log2 -Wl,--wrap=exp10 -Wl,--wrap=log10 -Wl,--wrap=pow -Wl,--wrap=powint -Wl,--wrap=hypot -Wl,--wrap=cbrt -Wl,--wrap=fmod -Wl,--wrap=drem -Wl,--wrap=remainder -Wl,--wrap=remquo -Wl,--wrap=expm1 -Wl,--wrap=log1p -Wl,--wrap=fma -Wl,--wrap=__aeabi_fadd -Wl,--wrap=__aeabi_fdiv -Wl,--wrap=__aeabi_fmul -Wl,--wrap=__aeabi_frsub -Wl,--wrap=__aeabi_fsub -Wl,--wrap=__aeabi_cfcmpeq -Wl,--wrap=__aeabi_cfrcmple -Wl,--wrap=__aeabi_cfcmple -Wl,--wrap=__aeabi_fcmpeq -Wl,--wrap=__aeabi_fcmplt -Wl,--wrap=__aeabi_fcmple -Wl,--wrap=__aeabi_fcmpge -Wl,--wrap=__aeabi_fcmpgt -Wl,--wrap=__aeabi_fcmpun -Wl,--wrap=__aeabi_i2f -Wl,--wrap=__aeabi_l2f -Wl,--wrap=__aeabi_ui2f -Wl,--wrap=__aeabi_ul2f -Wl,--wrap=__aeabi_f2iz -Wl,--wrap=__aeabi_f2lz -Wl,--wrap=__aeabi_f2uiz -Wl,--wrap=__aeabi_f2ulz -Wl,--wrap=__aeabi_f2d -Wl,--wrap=sqrtf -Wl,--wrap=cosf -Wl,--wrap=sinf -Wl,--wrap=tanf -Wl,--wrap=atan2f -Wl,--wrap=expf -Wl,--wrap=logf -Wl,--wrap=ldexpf -Wl,--wrap=copysignf -Wl,--wrap=truncf -Wl,--wrap=floorf -Wl,--wrap=ceilf -Wl,--wrap=roundf -Wl,--wrap=sincosf -Wl,--wrap=asinf -Wl,--wrap=acosf -Wl,--wrap=atanf -Wl,--wrap=sinhf -Wl,--wrap=coshf -Wl,--wrap=tanhf -Wl,--wrap=asinhf -Wl,--wrap=acoshf -Wl,--wrap=atanhf -Wl,--wrap=exp2f -Wl,--wrap=log2f -Wl,--wrap=exp10f -Wl,--wrap=log10f -Wl,--wrap=powf -Wl,--wrap=powintf -Wl,--wrap=hypotf -Wl,--wrap=cbrtf -Wl,--wrap=fmodf -Wl,--wrap=dremf -Wl,--wrap=remainderf -Wl,--wrap=remquof -Wl,--wrap=expm1f -Wl,--wrap=log1pf -Wl,--wrap=fmaf -Wl,--wrap=memcpy -Wl,--wrap=memset -Wl,--wrap=__aeabi_memcpy -Wl,--wrap=__aeabi_memset -Wl,--wrap=__aeabi_memcpy4 -Wl,--wrap=__aeabi_memset4 -Wl,--wrap=__aeabi_memcpy8 -Wl,--wrap=__aeabi_memset8 # Use toolchain libm if we're not using our own. ifndef INTERNAL_LIBM LIBS += -lm endif +LIBS += -lc + SRC_SDK := \ src/common/pico_sync/critical_section.c \ src/common/pico_sync/lock_core.c \ @@ -270,7 +272,6 @@ SRC_C += \ background.c \ peripherals/pins.c \ lib/crypto-algorithms/sha256.c \ - fatfs_port.c \ lib/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c \ lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c \ mphalport.c \ @@ -441,7 +442,7 @@ $(BUILD)/firmware.elf: $(OBJ) $(LINK_LD) $(STEPECHO) "LINK $@" $(Q)echo $(OBJ) > $(BUILD)/firmware.objs $(Q)echo $(PICO_LDFLAGS) > $(BUILD)/firmware.ldflags - $(Q)$(CC) -o $@ $(CFLAGS) @$(BUILD)/firmware.ldflags -Wl,-T,$(LINK_LD) -Wl,-Map=$@.map -Wl,-cref -Wl,--gc-sections @$(BUILD)/firmware.objs + $(Q)$(CC) -o $@ $(CFLAGS) @$(BUILD)/firmware.ldflags -Wl,-T,$(LINK_LD) -Wl,-Map=$@.map -Wl,-cref -Wl,--gc-sections @$(BUILD)/firmware.objs -Wl,-lc $(Q)$(SIZE) $@ | $(PYTHON) $(TOP)/tools/build_memory_info.py $(LINK_LD) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf diff --git a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk index 9773755649..f36fdd6ec7 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk +++ b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk @@ -14,7 +14,7 @@ CIRCUITPY_CYW43 = 1 CIRCUITPY_SSL = 1 CIRCUITPY_SSL_MBEDTLS = 1 CIRCUITPY_HASHLIB = 1 -CIRCUITPY_WEB_WORKFLOW = 0 +CIRCUITPY_WEB_WORKFLOW = 1 CIRCUITPY_MDNS = 0 CIRCUITPY_SOCKETPOOL = 1 CIRCUITPY_WIFI = 1 diff --git a/ports/raspberrypi/common-hal/socketpool/Socket.c b/ports/raspberrypi/common-hal/socketpool/Socket.c index 440fe56d42..be3f2cd087 100644 --- a/ports/raspberrypi/common-hal/socketpool/Socket.c +++ b/ports/raspberrypi/common-hal/socketpool/Socket.c @@ -166,6 +166,7 @@ static inline void exec_user_callback(socketpool_socket_obj_t *socket) { mp_sched_schedule(socket->callback, MP_OBJ_FROM_PTR(socket)); } #endif + supervisor_workflow_request_background(); } #if MICROPY_PY_LWIP_SOCK_RAW @@ -745,57 +746,47 @@ socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_ return socket; } -int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port) { - return -MP_EBADF; -} - -socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_obj_t *socket, - uint8_t *ip, uint32_t *port) { - if (socket->type != MOD_NETWORK_SOCK_STREAM) { - mp_raise_OSError(MP_EOPNOTSUPP); +int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port, socketpool_socket_obj_t *accepted) { + if (self->type != MOD_NETWORK_SOCK_STREAM) { + return -MP_EOPNOTSUPP; } - // Create new socket object, do it here because we must not raise an out-of-memory - // exception when the LWIP concurrency lock is held - socketpool_socket_obj_t *socket2 = m_new_ll_obj_with_finaliser(socketpool_socket_obj_t); - socket2->base.type = &socketpool_socket_type; + if (common_hal_socketpool_socket_get_closed(self)) { + return -MP_EBADF; + } MICROPY_PY_LWIP_ENTER - if (socket->pcb.tcp == NULL) { + if (self->pcb.tcp == NULL) { MICROPY_PY_LWIP_EXIT - m_del_obj(socketpool_socket_obj_t, socket2); - mp_raise_OSError(MP_EBADF); + return -MP_EBADF; } // I need to do this because "tcp_accepted", later, is a macro. - struct tcp_pcb *listener = socket->pcb.tcp; + struct tcp_pcb *listener = self->pcb.tcp; if (listener->state != LISTEN) { MICROPY_PY_LWIP_EXIT - m_del_obj(socketpool_socket_obj_t, socket2); - mp_raise_OSError(MP_EINVAL); + return -MP_EINVAL; } // accept incoming connection - struct tcp_pcb *volatile *incoming_connection = &lwip_socket_incoming_array(socket)[socket->incoming.connection.iget]; + struct tcp_pcb *volatile *incoming_connection = &lwip_socket_incoming_array(self)[self->incoming.connection.iget]; if (*incoming_connection == NULL) { - if (socket->timeout == 0) { + if (self->timeout == 0) { MICROPY_PY_LWIP_EXIT - m_del_obj(socketpool_socket_obj_t, socket2); - mp_raise_OSError(MP_EAGAIN); - } else if (socket->timeout != (unsigned)-1) { - mp_uint_t retries = socket->timeout / 100; - while (*incoming_connection == NULL) { + return -MP_EAGAIN; + } else if (self->timeout != (unsigned)-1) { + mp_uint_t retries = self->timeout / 100; + while (*incoming_connection == NULL && !mp_hal_is_interrupted()) { MICROPY_PY_LWIP_EXIT if (retries-- == 0) { - m_del_obj(socketpool_socket_obj_t, socket2); - mp_raise_OSError(MP_ETIMEDOUT); + return -MP_ETIMEDOUT; } mp_hal_delay_ms(100); MICROPY_PY_LWIP_REENTER } } else { - while (*incoming_connection == NULL) { + while (*incoming_connection == NULL && !mp_hal_is_interrupted()) { MICROPY_PY_LWIP_EXIT poll_sockets(); MICROPY_PY_LWIP_REENTER @@ -803,43 +794,75 @@ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_o } } + if (*incoming_connection == NULL) { + // We were interrupted. + return 0; + } + + // Close the accepted socket because we have another we accepted. + if (!common_hal_socketpool_socket_get_closed(accepted)) { + common_hal_socketpool_socket_close(accepted); + } + // We get a new pcb handle... - socket2->pcb.tcp = *incoming_connection; - if (++socket->incoming.connection.iget >= socket->incoming.connection.alloc) { - socket->incoming.connection.iget = 0; + accepted->pcb.tcp = *incoming_connection; + if (++self->incoming.connection.iget >= self->incoming.connection.alloc) { + self->incoming.connection.iget = 0; } *incoming_connection = NULL; // ...and set up the new socket for it. - socket2->domain = MOD_NETWORK_AF_INET; - socket2->type = MOD_NETWORK_SOCK_STREAM; - socket2->incoming.pbuf = NULL; - socket2->timeout = socket->timeout; - socket2->state = STATE_CONNECTED; - socket2->recv_offset = 0; - socket2->callback = MP_OBJ_NULL; - tcp_arg(socket2->pcb.tcp, (void *)socket2); - tcp_err(socket2->pcb.tcp, _lwip_tcp_error); - tcp_recv(socket2->pcb.tcp, _lwip_tcp_recv); + accepted->domain = MOD_NETWORK_AF_INET; + accepted->type = MOD_NETWORK_SOCK_STREAM; + accepted->incoming.pbuf = NULL; + accepted->timeout = self->timeout; + accepted->state = STATE_CONNECTED; + accepted->recv_offset = 0; + accepted->callback = MP_OBJ_NULL; + tcp_arg(accepted->pcb.tcp, (void *)accepted); + tcp_err(accepted->pcb.tcp, _lwip_tcp_error); + tcp_recv(accepted->pcb.tcp, _lwip_tcp_recv); tcp_accepted(listener); MICROPY_PY_LWIP_EXIT + // output values + memcpy(ip, &(accepted->pcb.tcp->remote_ip), NETUTILS_IPV4ADDR_BUFSIZE); + *port = (mp_uint_t)accepted->pcb.tcp->remote_port; + + return 1; +} + +socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_obj_t *socket, + uint8_t *ip, uint32_t *port) { + // Create new socket object, do it here because we must not raise an out-of-memory + // exception when the LWIP concurrency lock is held + socketpool_socket_obj_t *accepted = m_new_ll_obj_with_finaliser(socketpool_socket_obj_t); + socketpool_socket_reset(accepted); + + int ret = socketpool_socket_accept(socket, ip, port, accepted); + + if (ret <= 0) { + m_del_obj(socketpool_socket_obj_t, accepted); + if (ret == 0) { + // Interrupted. + return mp_const_none; + } + mp_raise_OSError(-ret); + } + DEBUG_printf("registering socket in socketpool_socket_accept()\n"); - if (!register_open_socket(socket2)) { + if (!register_open_socket(accepted)) { DEBUG_printf("collecting garbage to open socket\n"); gc_collect(); - if (!register_open_socket(socket2)) { + if (!register_open_socket(accepted)) { mp_raise_RuntimeError(translate("Out of sockets")); } } - mark_user_socket(socket2); + mark_user_socket(accepted); - // output values - memcpy(ip, &(socket2->pcb.tcp->remote_ip), NETUTILS_IPV4ADDR_BUFSIZE); - *port = (mp_uint_t)socket2->pcb.tcp->remote_port; - return MP_OBJ_FROM_PTR(socket2); + return MP_OBJ_FROM_PTR(accepted); } bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t *socket, @@ -847,21 +870,26 @@ bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t *socket, // get address ip_addr_t bind_addr; - int error = socketpool_resolve_host(socket->pool, host, &bind_addr); - if (error != 0) { - mp_raise_OSError(EHOSTUNREACH); - } + const ip_addr_t *bind_addr_ptr = &bind_addr; + if (hostlen > 0) { + int error = socketpool_resolve_host(socket->pool, host, &bind_addr); + if (error != 0) { + mp_raise_OSError(EHOSTUNREACH); + } + } else { + bind_addr_ptr = IP_ANY_TYPE; + } ip_set_option(socket->pcb.ip, SOF_REUSEADDR); err_t err = ERR_ARG; switch (socket->type) { case MOD_NETWORK_SOCK_STREAM: { - err = tcp_bind(socket->pcb.tcp, &bind_addr, port); + err = tcp_bind(socket->pcb.tcp, bind_addr_ptr, port); break; } case MOD_NETWORK_SOCK_DGRAM: { - err = udp_bind(socket->pcb.udp, &bind_addr, port); + err = udp_bind(socket->pcb.udp, bind_addr_ptr, port); break; } } @@ -1164,6 +1192,20 @@ void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t *self, uint self->timeout = timeout_ms; } +int common_hal_socketpool_socket_setsockopt(socketpool_socket_obj_t *self, int level, int optname, const void *value, size_t optlen) { + if (level == SOCKETPOOL_IPPROTO_TCP && optname == SOCKETPOOL_TCP_NODELAY) { + int one = 1; + bool enable = optlen == sizeof(&one) && memcmp(value, &one, optlen); + if (enable) { + tcp_set_flags(self->pcb.tcp, TF_NODELAY); + } else { + tcp_clear_flags(self->pcb.tcp, TF_NODELAY); + } + return 0; + } + return -MP_EOPNOTSUPP; +} + bool common_hal_socketpool_readable(socketpool_socket_obj_t *self) { MICROPY_PY_LWIP_ENTER; @@ -1206,3 +1248,32 @@ bool common_hal_socketpool_writable(socketpool_socket_obj_t *self) { return result; } + +void socketpool_socket_move(socketpool_socket_obj_t *self, socketpool_socket_obj_t *sock) { + *sock = *self; + self->state = _ERR_BADF; + + // Reregister the callbacks with the new socket copy. + MICROPY_PY_LWIP_ENTER; + + tcp_arg(self->pcb.tcp, NULL); + tcp_err(self->pcb.tcp, NULL); + tcp_recv(self->pcb.tcp, NULL); + + self->pcb.tcp = NULL; + + tcp_arg(sock->pcb.tcp, (void *)sock); + tcp_err(sock->pcb.tcp, _lwip_tcp_error); + tcp_recv(sock->pcb.tcp, _lwip_tcp_recv); + + MICROPY_PY_LWIP_EXIT; +} + +void socketpool_socket_reset(socketpool_socket_obj_t *self) { + if (self->base.type == &socketpool_socket_type) { + return; + } + self->base.type = &socketpool_socket_type; + self->pcb.tcp = NULL; + self->state = _ERR_BADF; +} diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 2a74c16e0a..cb3fc258af 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -73,13 +73,12 @@ NORETURN static void ro_attribute(int attr) { } bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) { - return true; + return self->enabled; } void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) { - if (!enabled) { - ro_attribute(MP_QSTR_enabled); - } + self->enabled = enabled; + // TODO: Actually enable and disable the WiFi module at this point. } mp_obj_t common_hal_wifi_radio_get_hostname(wifi_radio_obj_t *self) { @@ -242,6 +241,13 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_subnet_ap(wifi_radio_obj_t *self) { return common_hal_ipaddress_new_ipv4address(NETIF_AP->netmask.addr); } +uint32_t wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { + if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_STA) != CYW43_LINK_UP) { + return 0; + } + return NETIF_STA->ip_addr.addr; +} + mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_STA) != CYW43_LINK_UP) { return mp_const_none; diff --git a/ports/raspberrypi/common-hal/wifi/Radio.h b/ports/raspberrypi/common-hal/wifi/Radio.h index 0dc18c8957..b2e9df9e3a 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.h +++ b/ports/raspberrypi/common-hal/wifi/Radio.h @@ -35,6 +35,7 @@ typedef struct { mp_obj_base_t base; char hostname[254]; // hostname max is 253 chars, + 1 for trailing NUL wifi_scannednetworks_obj_t *current_scan; + bool enabled; } wifi_radio_obj_t; extern void common_hal_wifi_radio_gc_collect(wifi_radio_obj_t *self); diff --git a/ports/raspberrypi/fatfs_port.c b/ports/raspberrypi/fatfs_port.c deleted file mode 100644 index 58a0ef0d72..0000000000 --- a/ports/raspberrypi/fatfs_port.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George - * - * 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 "py/mphal.h" -#include "py/runtime.h" -#include "lib/oofatfs/ff.h" /* FatFs lower layer API */ -#include "lib/oofatfs/diskio.h" /* FatFs lower layer API */ -#include "shared/timeutils/timeutils.h" - -#if CIRCUITPY_RTC -#include "shared-bindings/rtc/RTC.h" -#endif - -DWORD get_fattime(void) { - #if CIRCUITPY_RTC - timeutils_struct_time_t tm; - common_hal_rtc_get_time(&tm); - return ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) | - (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1); - #else - return ((2016 - 1980) << 25) | ((9) << 21) | ((1) << 16) | ((16) << 11) | ((43) << 5) | (35 / 2); - #endif - - -} diff --git a/ports/stm/Makefile b/ports/stm/Makefile index cd37a9bda0..b69f8370c5 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -221,7 +221,6 @@ SRC_STM32 += boards/system_stm32$(MCU_SERIES_LOWER)xx.c SRC_C += \ background.c \ - fatfs_port.c \ mphalport.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ diff --git a/ports/stm/fatfs_port.c b/ports/stm/fatfs_port.c deleted file mode 100644 index 631f7f0982..0000000000 --- a/ports/stm/fatfs_port.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George - * - * 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 "py/runtime.h" -#include "lib/oofatfs/ff.h" - -DWORD get_fattime(void) { - // TODO: Implement this function. For now, fake it. - return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); -} diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index 7a60463c4b..fbf78a4cdc 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -344,38 +344,36 @@ STATIC mp_obj_t socketpool_socket_setblocking(mp_obj_t self_in, mp_obj_t blockin } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_setblocking_obj, socketpool_socket_setblocking); -// //| def setsockopt(self, level: int, optname: int, value: int) -> None: -// //| """Sets socket options""" -// //| ... -// //| -// STATIC mp_obj_t socketpool_socket_setsockopt(size_t n_args, const mp_obj_t *args) { -// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); +//| def setsockopt(self, level: int, optname: int, value: int) -> None: +//| """Sets socket options""" +//| ... +STATIC mp_obj_t socketpool_socket_setsockopt(size_t n_args, const mp_obj_t *args) { + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); + mp_int_t level = mp_obj_get_int(args[1]); + mp_int_t opt = mp_obj_get_int(args[2]); -// // mp_int_t level = mp_obj_get_int(args[1]); -// // mp_int_t opt = mp_obj_get_int(args[2]); + const void *optval; + mp_uint_t optlen; + mp_int_t val; + if (mp_obj_is_integer(args[3])) { + val = mp_obj_get_int_truncated(args[3]); + optval = &val; + optlen = sizeof(val); + } else { + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[3], &bufinfo, MP_BUFFER_READ); + optval = bufinfo.buf; + optlen = bufinfo.len; + } -// // const void *optval; -// // mp_uint_t optlen; -// // mp_int_t val; -// // if (mp_obj_is_integer(args[3])) { -// // val = mp_obj_get_int_truncated(args[3]); -// // optval = &val; -// // optlen = sizeof(val); -// // } else { -// // mp_buffer_info_t bufinfo; -// // mp_get_buffer_raise(args[3], &bufinfo, MP_BUFFER_READ); -// // optval = bufinfo.buf; -// // optlen = bufinfo.len; -// // } + int _errno = common_hal_socketpool_socket_setsockopt(self, level, opt, optval, optlen); + if (_errno < 0) { + mp_raise_OSError(-_errno); + } -// // int _errno; -// // if (self->nic_type->setsockopt(self, level, opt, optval, optlen, &_errno) != 0) { -// // mp_raise_OSError(_errno); -// // } - -// return mp_const_none; -// } -// STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_setsockopt_obj, 4, 4, socketpool_socket_setsockopt); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_setsockopt_obj, 4, 4, socketpool_socket_setsockopt); //| def settimeout(self, value: int) -> None: @@ -417,7 +415,7 @@ STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_sendall), MP_ROM_PTR(&socketpool_socket_sendall_obj) }, { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socketpool_socket_sendto_obj) }, { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socketpool_socket_setblocking_obj) }, - // { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&socketpool_socket_setsockopt_obj) }, + { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&socketpool_socket_setsockopt_obj) }, { MP_ROM_QSTR(MP_QSTR_settimeout), MP_ROM_PTR(&socketpool_socket_settimeout_obj) }, }; diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index cf5a97a428..690c9f8363 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -46,13 +46,22 @@ mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t *self, const mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t *self, const char *host, size_t hostlen, uint32_t port, const uint8_t *buf, uint32_t len); void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t *self, uint32_t timeout_ms); +int common_hal_socketpool_socket_setsockopt(socketpool_socket_obj_t *self, int level, int optname, const void *value, size_t optlen); bool common_hal_socketpool_readable(socketpool_socket_obj_t *self); bool common_hal_socketpool_writable(socketpool_socket_obj_t *self); // Non-allocating versions for internal use. -int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port); +int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port, socketpool_socket_obj_t *accepted); void socketpool_socket_close(socketpool_socket_obj_t *self); int socketpool_socket_send(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len); int socketpool_socket_recv_into(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len); + +// Moves self to sock without closing the real socket. self will think its closed afterwards. +void socketpool_socket_move(socketpool_socket_obj_t *self, socketpool_socket_obj_t *sock); + +// Resets the socket object state so it appears closed and disconnected. This only works on +// uninitialized memory. +void socketpool_socket_reset(socketpool_socket_obj_t *self); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index e500784f1f..278288fa7e 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -52,7 +52,6 @@ //| returned by :py:attr:`wifi.radio` //| """ //| ... - STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 1, false); @@ -65,12 +64,6 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(s); } -//| AF_INET: int -//| AF_INET6: int -//| SOCK_STREAM: int -//| SOCK_DGRAM: int -//| SOCK_RAW: int -//| //| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM) -> socketpool.Socket: //| """Create a new socket //| @@ -114,7 +107,6 @@ MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_socket_obj, 1, socketpool_socke //| address information to call socket.socket() and socket.connect() with, //| as a tuple.""" //| ... -//| STATIC mp_obj_t socketpool_socketpool_getaddrinfo(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_host, ARG_port, ARG_family, ARG_type, ARG_proto, ARG_flags }; static const mp_arg_t allowed_args[] = { @@ -164,12 +156,28 @@ STATIC const mp_rom_map_elem_t socketpool_socketpool_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_getaddrinfo), MP_ROM_PTR(&socketpool_socketpool_getaddrinfo_obj) }, // class constants +//| AF_INET: int { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(SOCKETPOOL_AF_INET) }, +//| AF_INET6: int { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(SOCKETPOOL_AF_INET6) }, +//| +//| SOCK_STREAM: int { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(SOCKETPOOL_SOCK_STREAM) }, +//| SOCK_DGRAM: int { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(SOCKETPOOL_SOCK_DGRAM) }, +//| SOCK_RAW: int { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(SOCKETPOOL_SOCK_RAW) }, +//| + +//| TCP_NODELAY: int + { MP_ROM_QSTR(MP_QSTR_TCP_NODELAY), MP_ROM_INT(SOCKETPOOL_TCP_NODELAY) }, +//| + +//| IPPROTO_TCP: int +//| + { MP_ROM_QSTR(MP_QSTR_IPPROTO_TCP), MP_ROM_INT(SOCKETPOOL_IPPROTO_TCP) }, +//| }; STATIC MP_DEFINE_CONST_DICT(socketpool_socketpool_locals_dict, socketpool_socketpool_locals_dict_table); diff --git a/shared-bindings/socketpool/SocketPool.h b/shared-bindings/socketpool/SocketPool.h index 92382078e1..5a2d9f4337 100644 --- a/shared-bindings/socketpool/SocketPool.h +++ b/shared-bindings/socketpool/SocketPool.h @@ -34,16 +34,24 @@ extern const mp_obj_type_t socketpool_socketpool_type; typedef enum { - SOCKETPOOL_SOCK_STREAM, - SOCKETPOOL_SOCK_DGRAM, - SOCKETPOOL_SOCK_RAW + SOCKETPOOL_SOCK_STREAM = 1, + SOCKETPOOL_SOCK_DGRAM = 2, + SOCKETPOOL_SOCK_RAW = 3 } socketpool_socketpool_sock_t; typedef enum { - SOCKETPOOL_AF_INET, - SOCKETPOOL_AF_INET6 + SOCKETPOOL_AF_INET = 2, + SOCKETPOOL_AF_INET6 = 10 } socketpool_socketpool_addressfamily_t; +typedef enum { + SOCKETPOOL_IPPROTO_TCP = 6, +} socketpool_socketpool_ipproto_t; + +typedef enum { + SOCKETPOOL_TCP_NODELAY = 1, +} socketpool_socketpool_tcpopt_t; + void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t *self, mp_obj_t radio); socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_t *self, diff --git a/supervisor/fatfs_port.h b/supervisor/fatfs.h similarity index 89% rename from supervisor/fatfs_port.h rename to supervisor/fatfs.h index e76ced524d..59226aae1c 100644 --- a/supervisor/fatfs_port.h +++ b/supervisor/fatfs.h @@ -24,11 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SUPERVISOR_FATFS_PORT_H -#define MICROPY_INCLUDED_SUPERVISOR_FATFS_PORT_H +#ifndef MICROPY_INCLUDED_SUPERVISOR_FATFS_H +#define MICROPY_INCLUDED_SUPERVISOR_FATFS_H #include "lib/oofatfs/ff.h" void override_fattime(DWORD time); -#endif // MICROPY_INCLUDED_SUPERVISOR_FATFS_PORT_H +#endif // MICROPY_INCLUDED_SUPERVISOR_FATFS_H diff --git a/supervisor/shared/bluetooth/file_transfer.c b/supervisor/shared/bluetooth/file_transfer.c index 159c639e4d..ae24c29899 100644 --- a/supervisor/shared/bluetooth/file_transfer.c +++ b/supervisor/shared/bluetooth/file_transfer.c @@ -42,7 +42,7 @@ #include "common-hal/_bleio/__init__.h" -#include "supervisor/fatfs_port.h" +#include "supervisor/fatfs.h" #include "supervisor/filesystem.h" #include "supervisor/shared/reload.h" #include "supervisor/shared/bluetooth/file_transfer.h" diff --git a/ports/nrf/fatfs_port.c b/supervisor/shared/fatfs.c similarity index 94% rename from ports/nrf/fatfs_port.c rename to supervisor/shared/fatfs.c index 38c2d923b8..76db02d6bf 100644 --- a/ports/nrf/fatfs_port.c +++ b/supervisor/shared/fatfs.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2022 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 @@ -24,12 +24,13 @@ * THE SOFTWARE. */ +#include "supervisor/fatfs.h" + #include "py/runtime.h" #include "lib/oofatfs/ff.h" #include "shared/timeutils/timeutils.h" #include "shared-bindings/rtc/RTC.h" #include "shared-bindings/time/__init__.h" -#include "supervisor/fatfs_port.h" DWORD _time_override = 0; DWORD get_fattime(void) { diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 3f0b9ad8f7..2d6025b6aa 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -24,18 +24,20 @@ * THE SOFTWARE. */ +#include #include #include "extmod/vfs.h" #include "extmod/vfs_fat.h" #include "genhdr/mpversion.h" +#include "py/mperrno.h" #include "py/mpstate.h" #include "py/stackctrl.h" #include "shared-bindings/wifi/Radio.h" #include "shared-module/storage/__init__.h" #include "shared/timeutils/timeutils.h" -#include "supervisor/fatfs_port.h" +#include "supervisor/fatfs.h" #include "supervisor/filesystem.h" #include "supervisor/port.h" #include "supervisor/shared/reload.h" @@ -47,8 +49,12 @@ #include "shared-bindings/hashlib/__init__.h" #include "shared-bindings/hashlib/Hash.h" + +#if CIRCUITPY_MDNS #include "shared-bindings/mdns/RemoteService.h" #include "shared-bindings/mdns/Server.h" +#endif + #include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/socketpool/__init__.h" #include "shared-bindings/socketpool/Socket.h" @@ -62,11 +68,6 @@ #include "shared-module/dotenv/__init__.h" #endif -// TODO: Remove ESP specific stuff. For now, it is useful as we refine the server. -#include "esp_log.h" - -static const char *TAG = "CP webserver"; - enum request_state { STATE_METHOD, STATE_PATH, @@ -95,6 +96,7 @@ typedef struct { bool expect; bool json; bool websocket; + bool new_socket; uint32_t websocket_version; // RFC6455 for websockets says this header should be 24 base64 characters long. char websocket_key[24 + 1]; @@ -109,7 +111,10 @@ static uint32_t _last_ip = 0; static wifi_radio_error_t _last_wifi_status = WIFI_RADIO_ERROR_NONE; #endif +#if CIRCUITPY_MDNS static mdns_server_obj_t mdns; +#endif + static uint32_t web_api_port = 80; static socketpool_socketpool_obj_t pool; @@ -271,7 +276,7 @@ void supervisor_start_web_workflow(void) { // attempting to connect to the given network. _wifi_status = common_hal_wifi_radio_connect( &common_hal_wifi_radio_obj, (uint8_t *)ssid, ssid_len, (uint8_t *)password, password_len, - 0, 0.1, NULL, 0); + 0, 8, NULL, 0); if (_wifi_status != WIFI_RADIO_ERROR_NONE) { common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, false); @@ -289,21 +294,20 @@ void supervisor_start_web_workflow(void) { new_port = strtoul(port_encoded, NULL, 10); } - bool first_start = mdns.base.type != &mdns_server_type; + bool first_start = pool.base.type != &socketpool_socketpool_type; bool port_changed = new_port != web_api_port; if (first_start) { - ESP_LOGI(TAG, "Starting web workflow"); + #if CIRCUITPY_MDNS mdns_server_construct(&mdns, true); mdns.base.type = &mdns_server_type; common_hal_mdns_server_set_instance_name(&mdns, MICROPY_HW_BOARD_NAME); + #endif pool.base.type = &socketpool_socketpool_type; common_hal_socketpool_socketpool_construct(&pool, &common_hal_wifi_radio_obj); - listening.base.type = &socketpool_socket_type; - active.base.type = &socketpool_socket_type; - active.num = -1; - active.connected = false; + socketpool_socket_reset(&listening); + socketpool_socket_reset(&active); websocket_init(); } @@ -312,7 +316,9 @@ void supervisor_start_web_workflow(void) { } if (first_start || port_changed) { web_api_port = new_port; + #if CIRCUITPY_MDNS common_hal_mdns_server_advertise_service(&mdns, "_circuitpython", "_tcp", web_api_port); + #endif socketpool_socket(&pool, SOCKETPOOL_AF_INET, SOCKETPOOL_SOCK_STREAM, &listening); common_hal_socketpool_socket_settimeout(&listening, 0); // Bind to any ip. @@ -326,17 +332,13 @@ void supervisor_start_web_workflow(void) { _api_password[api_password_len + 1] = '\0'; _base64_in_place(_api_password, api_password_len + 1, sizeof(_api_password)); } - - // TODO: - // GET /edit/ - // - Super basic editor #endif } void web_workflow_send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len) { int total_sent = 0; - int sent = -EAGAIN; - while ((sent == -EAGAIN || (sent > 0 && total_sent < len)) && + int sent = -MP_EAGAIN; + while ((sent == -MP_EAGAIN || (sent > 0 && total_sent < len)) && common_hal_socketpool_socket_get_connected(socket)) { sent = socketpool_socket_send(socket, buf + total_sent, len - total_sent); if (sent > 0) { @@ -347,9 +349,6 @@ void web_workflow_send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, } } } - if (total_sent < len) { - ESP_LOGE(TAG, "short send %d %d", sent, len); - } } STATIC void _print_raw(void *env, const char *str, size_t len) { @@ -436,13 +435,15 @@ const char *ok_hosts[] = { static bool _origin_ok(const char *origin) { const char *http = "http://"; - const char *local = ".local"; // note: redirected requests send an Origin of "null" and will be caught by this if (strncmp(origin, http, strlen(http)) != 0) { return false; } // These are prefix checks up to : so that any port works. + // TODO: Support DHCP hostname in addition to MDNS. + #if CIRCUITPY_MDNS + const char *local = ".local"; const char *hostname = common_hal_mdns_server_get_hostname(&mdns); const char *end = origin + strlen(http) + strlen(hostname) + strlen(local); if (strncmp(origin + strlen(http), hostname, strlen(hostname)) == 0 && @@ -450,6 +451,9 @@ static bool _origin_ok(const char *origin) { (end[0] == '\0' || end[0] == ':')) { return true; } + #else + const char *end; + #endif _update_encoded_ip(); end = origin + strlen(http) + strlen(_our_ip_encoded); @@ -604,9 +608,10 @@ static void _reply_server_error(socketpool_socket_obj_t *socket, _request *reque _send_str(socket, "\r\n"); } +#if CIRCUITPY_MDNS static void _reply_redirect(socketpool_socket_obj_t *socket, _request *request, const char *path) { int nodelay = 1; - lwip_setsockopt(socket->num, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); + common_hal_socketpool_socket_setsockopt(socket, SOCKETPOOL_IPPROTO_TCP, SOCKETPOOL_TCP_NODELAY, &nodelay, sizeof(nodelay)); const char *hostname = common_hal_mdns_server_get_hostname(&mdns); _send_strs(socket, "HTTP/1.1 307 Temporary Redirect\r\n", @@ -628,6 +633,7 @@ static void _reply_redirect(socketpool_socket_obj_t *socket, _request *request, _cors_header(socket, request); _send_str(socket, "\r\n"); } +#endif static void _reply_directory_json(socketpool_socket_obj_t *socket, _request *request, FF_DIR *dir, const char *request_path, const char *path) { socketpool_socket_send(socket, (const uint8_t *)OK_JSON, strlen(OK_JSON)); @@ -710,10 +716,9 @@ static void _reply_with_file(socketpool_socket_obj_t *socket, _request *request, while (send_offset < quantity_read) { int sent = socketpool_socket_send(socket, data_buffer + send_offset, quantity_read - send_offset); if (sent < 0) { - if (sent == -EAGAIN) { + if (sent == -MP_EAGAIN) { sent = 0; } else { - ESP_LOGE(TAG, "file send error %d", sent); break; } } @@ -726,15 +731,20 @@ static void _reply_with_file(socketpool_socket_obj_t *socket, _request *request, } static void _reply_with_devices_json(socketpool_socket_obj_t *socket, _request *request) { + #if CIRCUITPY_MDNS mdns_remoteservice_obj_t found_devices[32]; size_t total_results = mdns_server_find(&mdns, "_circuitpython", "_tcp", 1, found_devices, MP_ARRAY_SIZE(found_devices)); size_t count = MIN(total_results, MP_ARRAY_SIZE(found_devices)); + #else + size_t total_results = 0; + #endif socketpool_socket_send(socket, (const uint8_t *)OK_JSON, strlen(OK_JSON)); _cors_header(socket, request); _send_str(socket, "\r\n"); mp_print_t _socket_print = {socket, _print_chunk}; mp_printf(&_socket_print, "{\"total\": %d, \"devices\": [", total_results); + #if CIRCUITPY_MDNS for (size_t i = 0; i < count; i++) { if (i > 0) { _send_chunk(socket, ","); @@ -751,6 +761,7 @@ static void _reply_with_devices_json(socketpool_socket_obj_t *socket, _request * "\"ip\": \"%d.%d.%d.%d\"}", hostname, instance_name, port, octets[0], octets[1], octets[2], octets[3]); common_hal_mdns_remoteservice_deinit(&found_devices[i]); } + #endif _send_chunk(socket, "]}"); // Empty chunk signals the end of the response. _send_chunk(socket, ""); @@ -762,7 +773,11 @@ static void _reply_with_version_json(socketpool_socket_obj_t *socket, _request * _send_str(socket, "\r\n"); mp_print_t _socket_print = {socket, _print_chunk}; + #if CIRCUITPY_MDNS const char *hostname = common_hal_mdns_server_get_hostname(&mdns); + #else + const char *hostname = ""; + #endif _update_encoded_ip(); // Note: this leverages the fact that C concats consecutive string literals together. mp_printf(&_socket_print, @@ -848,7 +863,6 @@ static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *req return; } if (result != FR_OK) { - ESP_LOGE(TAG, "file write error %d %s", result, path); override_fattime(0); #if CIRCUITPY_USB_MSC usb_msc_unlock(); @@ -888,19 +902,13 @@ static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *req size_t read_len = MIN(sizeof(bytes), request->content_length - total_read); int len = socketpool_socket_recv_into(socket, bytes, read_len); if (len < 0) { - if (len == -EAGAIN) { + if (len == -MP_EAGAIN) { continue; - } else { - ESP_LOGE(TAG, "other error %d", len); } error = true; break; } - UINT actual; - f_write(&active_file, bytes, len, &actual); - if (actual != (UINT)len) { - ESP_LOGE(TAG, "didn't write whole file"); - } + f_write(&active_file, bytes, len, NULL); total_read += len; } @@ -934,7 +942,7 @@ STATIC_FILE(blinka_16x16_ico); static void _reply_static(socketpool_socket_obj_t *socket, _request *request, const uint8_t *response, size_t response_len, const char *content_type) { uint32_t total_length = response_len; char encoded_len[10]; - snprintf(encoded_len, sizeof(encoded_len), "%d", total_length); + snprintf(encoded_len, sizeof(encoded_len), "%" PRIu32, total_length); _send_strs(socket, "HTTP/1.1 200 OK\r\n", @@ -1004,9 +1012,10 @@ static void _decode_percents(char *str) { static bool _reply(socketpool_socket_obj_t *socket, _request *request) { if (request->redirect) { + #if CIRCUITPY_MDNS _reply_redirect(socket, request, request->path); + #endif } else if (strlen(request->origin) > 0 && !_origin_ok(request->origin)) { - ESP_LOGE(TAG, "bad origin %s", request->origin); _reply_forbidden(socket, request); } else if (strncmp(request->path, "/fs/", 4) == 0) { if (strcasecmp(request->method, "OPTIONS") == 0) { @@ -1061,7 +1070,6 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { if (result == FR_NO_PATH || result == FR_NO_FILE) { _reply_missing(socket, request); } else if (result != FR_OK) { - ESP_LOGE(TAG, "rm error %d %s", result, path); _reply_server_error(socket, request); } else { _reply_no_content(socket, request); @@ -1089,7 +1097,6 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } else if (result == FR_NO_PATH || result == FR_NO_FILE) { // Missing higher directories or target file. _reply_missing(socket, request); } else if (result != FR_OK) { - ESP_LOGE(TAG, "move error %d %s", result, path); _reply_server_error(socket, request); } else { _reply_created(socket, request); @@ -1137,7 +1144,6 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) { } else if (result == FR_NO_PATH) { _reply_missing(socket, request); } else if (result != FR_OK) { - ESP_LOGE(TAG, "mkdir error %d %s", result, path); _reply_server_error(socket, request); } else { _reply_created(socket, request); @@ -1237,6 +1243,7 @@ static void _reset_request(_request *request) { request->redirect = false; request->done = false; request->in_progress = false; + request->new_socket = false; request->authenticated = false; request->expect = false; request->json = false; @@ -1257,6 +1264,7 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) if (!request->in_progress) { autoreload_suspend(AUTORELOAD_SUSPEND_WEB); request->in_progress = true; + request->new_socket = false; } switch (request->state) { case STATE_METHOD: { @@ -1276,7 +1284,6 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) if (c == ' ') { request->path[request->offset] = '\0'; request->offset = 0; - ESP_LOGI(TAG, "Request %s %s", request->method, request->path); request->state = STATE_VERSION; } else if (request->offset > sizeof(request->path) - 1) { // Skip methods that are too long. @@ -1352,7 +1359,6 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) } else if (strcasecmp(request->header_key, "X-Destination") == 0) { strcpy(request->destination, request->header_value); } - ESP_LOGI(TAG, "Header %s %s", request->header_key, request->header_value); } else if (request->offset > sizeof(request->header_value) - 1) { // Skip methods that are too long. } else { @@ -1369,8 +1375,9 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) } if (error) { const char *error_response = "HTTP/1.1 501 Not Implemented\r\n\r\n"; + int nodelay = 1; - lwip_setsockopt(socket->num, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); + common_hal_socketpool_socket_setsockopt(socket, SOCKETPOOL_IPPROTO_TCP, SOCKETPOOL_TCP_NODELAY, &nodelay, sizeof(nodelay)); socketpool_socket_send(socket, (const uint8_t *)error_response, strlen(error_response)); } if (!request->done) { @@ -1386,37 +1393,8 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) void supervisor_web_workflow_background(void) { - // Otherwise, see if we have another socket to accept. - if ((!common_hal_socketpool_socket_get_connected(&active) || !active_request.in_progress) && - !common_hal_socketpool_socket_get_closed(&listening) && - listening.num > 0) { - uint32_t ip; - uint32_t port; - int newsoc = socketpool_socket_accept(&listening, (uint8_t *)&ip, &port); - if (newsoc == -EBADF) { - common_hal_socketpool_socket_close(&listening); - return; - } - if (newsoc > 0) { - // Close the active socket because we have another we accepted. - if (!common_hal_socketpool_socket_get_closed(&active)) { - common_hal_socketpool_socket_close(&active); - } - // TODO: Don't do this because it uses the private struct layout. - // Create the socket - active.num = newsoc; - active.pool = &pool; - active.connected = true; - - common_hal_socketpool_socket_settimeout(&active, 0); - - _reset_request(&active_request); - - lwip_fcntl(newsoc, F_SETFL, O_NONBLOCK); - } - } - - // If we have a request in progress, continue working on it. + // If we have a request in progress, continue working on it. Do this first + // so that we can accept another socket after finishing this request. if (common_hal_socketpool_socket_get_connected(&active)) { _process_request(&active, &active_request); } else { @@ -1424,6 +1402,28 @@ void supervisor_web_workflow_background(void) { common_hal_socketpool_socket_close(&active); } + // Otherwise, see if we have another socket to accept. + if ((!common_hal_socketpool_socket_get_connected(&active) || + (!active_request.in_progress && !active_request.new_socket)) && + !common_hal_socketpool_socket_get_closed(&listening)) { + uint32_t ip; + uint32_t port; + int newsoc = socketpool_socket_accept(&listening, (uint8_t *)&ip, &port, &active); + if (newsoc == -EBADF) { + common_hal_socketpool_socket_close(&listening); + return; + } + if (newsoc > 0) { + common_hal_socketpool_socket_settimeout(&active, 0); + + _reset_request(&active_request); + // Mark new sockets, otherwise we may accept another before the first + // could start its request. + active_request.new_socket = true; + } + } + + websocket_background(); } diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c index 3901c4eefe..9d1cf9919f 100644 --- a/supervisor/shared/web_workflow/websocket.c +++ b/supervisor/shared/web_workflow/websocket.c @@ -29,15 +29,13 @@ #include "py/ringbuf.h" #include "py/runtime.h" #include "shared/runtime/interrupt_char.h" +#include "shared-bindings/socketpool/SocketPool.h" #include "supervisor/shared/web_workflow/web_workflow.h" #if CIRCUITPY_STATUS_BAR #include "supervisor/shared/status_bar.h" #endif -// TODO: Remove ESP specific stuff. For now, it is useful as we refine the server. -#include "esp_log.h" - typedef struct { socketpool_socket_obj_t socket; uint8_t opcode; @@ -57,24 +55,18 @@ STATIC uint8_t _buf[16]; static _websocket cp_serial; -static const char *TAG = "CP websocket"; - void websocket_init(void) { - cp_serial.socket.num = -1; - cp_serial.socket.connected = false; + socketpool_socket_reset(&cp_serial.socket); ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf) - 1); } void websocket_handoff(socketpool_socket_obj_t *socket) { - cp_serial.socket = *socket; + socketpool_socket_move(socket, &cp_serial.socket); cp_serial.closed = false; cp_serial.opcode = 0; cp_serial.frame_index = 0; cp_serial.frame_len = 2; - // Mark the original socket object as closed without telling the lower level. - socket->connected = false; - socket->num = -1; #if CIRCUITPY_STATUS_BAR // Send the title bar for the new client. @@ -89,9 +81,6 @@ bool websocket_connected(void) { static bool _read_byte(uint8_t *c) { int len = socketpool_socket_recv_into(&cp_serial.socket, c, 1); if (len != 1) { - if (len != -EAGAIN) { - ESP_LOGE(TAG, "recv error %d", len); - } return false; } return true; @@ -147,13 +136,10 @@ static void _read_next_frame_header(void) { // Set the TCP socket to send immediately so that we send the payload back before // closing the connection. int nodelay = 1; - lwip_setsockopt(cp_serial.socket.num, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); + common_hal_socketpool_socket_setsockopt(&cp_serial.socket, SOCKETPOOL_IPPROTO_TCP, SOCKETPOOL_TCP_NODELAY, &nodelay, sizeof(nodelay)); } uint8_t frame_header[2]; frame_header[0] = 1 << 7 | opcode; - if (cp_serial.payload_remaining > 125) { - ESP_LOGE(TAG, "CLOSE or PING has long payload"); - } frame_header[1] = cp_serial.payload_remaining; web_workflow_send_raw(&cp_serial.socket, (const uint8_t *)frame_header, 2); } diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index a8deb9606d..801025f41a 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -4,6 +4,7 @@ SRC_SUPERVISOR = \ supervisor/shared/background_callback.c \ supervisor/shared/board.c \ supervisor/shared/cpu.c \ + supervisor/shared/fatfs.c \ supervisor/shared/flash.c \ supervisor/shared/lock.c \ supervisor/shared/memory.c \ From fa4b480439eb7159b4f803a916eab062d56b6593 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 21 Nov 2022 20:21:39 -0600 Subject: [PATCH 139/357] looking into how null show works --- shared-module/displayio/Display.c | 17 +++++++++++++++++ shared-module/displayio/Display.h | 2 +- shared-module/displayio/display_core.c | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 2d65e88836..780c4a9136 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -136,11 +136,28 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, // Set the group after initialization otherwise we may send pixels while we delay in // initialization. + mp_printf(&mp_plat_print, "Inside display make_new\n"); + is_null(&circuitpython_splash); + //is_null(0); +// if(circuitpython_splash == mp_const_none) { +// mp_printf(&mp_plat_print, "Splash is NULL \n"); +// } +// mp_printf(&mp_plat_print, *circuitpython_splash); +// mp_printf(&mp_plat_print, "\n"); common_hal_displayio_display_show(self, &circuitpython_splash); common_hal_displayio_display_set_auto_refresh(self, auto_refresh); } +void is_null(displayio_group_t *root_group){ + if (root_group == NULL){ + mp_printf(&mp_plat_print, "root_group is null\n"); + } +} + bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group) { + if(root_group == NULL){ + mp_printf(&mp_plat_print, "Its NULL fer flucks snakes\n"); + } return displayio_display_core_set_root_group(&self->core, root_group); } diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index f513a9d462..eb356a388c 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -64,7 +64,7 @@ typedef struct { void displayio_display_background(displayio_display_obj_t *self); void release_display(displayio_display_obj_t *self); void reset_display(displayio_display_obj_t *self); - +void is_null(displayio_group_t *root_group); void displayio_display_collect_ptrs(displayio_display_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_DISPLAY_H diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index eadb0ebd4c..635694914f 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -169,7 +169,7 @@ bool displayio_display_core_set_root_group(displayio_display_core_t *self, displ // force the circuit_python_splash out of any group (Note: could cause problems with the parent group) circuitpython_splash.x = 0; // reset position in case someone moved it. circuitpython_splash.y = 0; - + mp_printf(&mp_plat_print, "Inside set root group NULL\n"); supervisor_start_terminal(self->width, self->height); root_group = &circuitpython_splash; From dc2039058851b89a46a70aa3ac76d73a3b7f6c67 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 22 Nov 2022 09:04:12 -0800 Subject: [PATCH 140/357] Fix stubs --- shared-bindings/socketpool/SocketPool.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 278288fa7e..097cb4f39a 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -63,7 +63,16 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(s); } - +//| AF_INET: int +//| AF_INET6: int +//| +//| SOCK_STREAM: int +//| SOCK_DGRAM: int +//| SOCK_RAW: int +//| +//| TCP_NODELAY: int +//| +//| IPPROTO_TCP: int //| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM) -> socketpool.Socket: //| """Create a new socket //| @@ -107,6 +116,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_socket_obj, 1, socketpool_socke //| address information to call socket.socket() and socket.connect() with, //| as a tuple.""" //| ... +//| STATIC mp_obj_t socketpool_socketpool_getaddrinfo(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_host, ARG_port, ARG_family, ARG_type, ARG_proto, ARG_flags }; static const mp_arg_t allowed_args[] = { @@ -156,28 +166,16 @@ STATIC const mp_rom_map_elem_t socketpool_socketpool_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_getaddrinfo), MP_ROM_PTR(&socketpool_socketpool_getaddrinfo_obj) }, // class constants -//| AF_INET: int { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(SOCKETPOOL_AF_INET) }, -//| AF_INET6: int { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(SOCKETPOOL_AF_INET6) }, -//| -//| SOCK_STREAM: int { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(SOCKETPOOL_SOCK_STREAM) }, -//| SOCK_DGRAM: int { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(SOCKETPOOL_SOCK_DGRAM) }, -//| SOCK_RAW: int { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(SOCKETPOOL_SOCK_RAW) }, -//| -//| TCP_NODELAY: int { MP_ROM_QSTR(MP_QSTR_TCP_NODELAY), MP_ROM_INT(SOCKETPOOL_TCP_NODELAY) }, -//| -//| IPPROTO_TCP: int -//| { MP_ROM_QSTR(MP_QSTR_IPPROTO_TCP), MP_ROM_INT(SOCKETPOOL_IPPROTO_TCP) }, -//| }; STATIC MP_DEFINE_CONST_DICT(socketpool_socketpool_locals_dict, socketpool_socketpool_locals_dict_table); From 167a50658a1367927f5403e4c11deedd7690b875 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 22 Nov 2022 09:42:59 -0800 Subject: [PATCH 141/357] Try and fix ci change script --- tools/ci_changes_per_commit.py | 38 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tools/ci_changes_per_commit.py b/tools/ci_changes_per_commit.py index dd957b2a56..e38c98f40e 100644 --- a/tools/ci_changes_per_commit.py +++ b/tools/ci_changes_per_commit.py @@ -129,6 +129,7 @@ class Query: if request.status_code == 200: return request.json() else: + print(request.json()) raise Exception("Query Failed: {}".format(request.status_code)) @@ -164,7 +165,7 @@ def get_commit_and_checksuite(query_commits): return [None, None] -def append_runs_to_list(runs, list): +def append_runs_to_list(runs, bad_runs_by_matrix): regex_matrix = re.compile("^build-[^ ]+") regex_board = re.compile("\([^ ]+\)$") for run in runs["nodes"]: @@ -172,27 +173,32 @@ def append_runs_to_list(runs, list): res_matrix = regex_matrix.search(name) if res_matrix: matrix = res_matrix.group() - if matrix not in list: - list[matrix] = [] - list[matrix].append(regex_board.search(name).group()[1:-1]) + if matrix not in bad_runs_by_matrix: + bad_runs_by_matrix[matrix] = [] + res_board = regex_board.search(name) + if res_board: + bad_runs_by_matrix[matrix].append(res_board.group()[1:-1]) -def get_bad_checkruns(query_checkruns, list={}): - checkruns = query_checkruns.fetch()["data"]["node"] - run_types = ["failed", "incomplete"] - paginate = False +def get_bad_checkruns(query_checkruns): + more_pages = True + bad_runs_by_matrix = {} + while more_pages: + checkruns = query_checkruns.fetch()["data"]["node"] + run_types = ["failed", "incomplete"] + more_pages = False - for run_type in run_types: - run_type_camel = run_type.capitalize() + "Run" - run_type = run_type + "Runs" + for run_type in run_types: + run_type_camel = run_type.capitalize() + "Run" + run_type = run_type + "Runs" - append_runs_to_list(checkruns[run_type], list) + append_runs_to_list(checkruns[run_type], bad_runs_by_matrix) - if query_checkruns.paginate(checkruns[run_type]["pageInfo"], "after" + run_type_camel): - query_checkruns.variables["include" + run_type_camel] = True - paginate = True + if query_checkruns.paginate(checkruns[run_type]["pageInfo"], "after" + run_type_camel): + query_checkruns.variables["include" + run_type_camel] = True + more_pages = True - return get_bad_checkruns(query_checkruns, list) if paginate else list + return bad_runs_by_matrix def main(): From 17be447c4bae7aeb63d3ad617c87fcdc2b0cacf5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 22 Nov 2022 16:09:47 -0500 Subject: [PATCH 142/357] correct Radio.connect() and .start_ap() signatures; clean up some code --- ports/espressif/common-hal/wifi/Network.c | 18 ++--- ports/espressif/common-hal/wifi/Radio.c | 13 ++-- ports/raspberrypi/common-hal/wifi/Network.c | 8 +-- ports/raspberrypi/common-hal/wifi/Radio.c | 2 +- shared-bindings/wifi/AuthMode.h | 14 ++-- shared-bindings/wifi/Radio.c | 74 ++++++++++++--------- shared-bindings/wifi/Radio.h | 2 +- 7 files changed, 70 insertions(+), 61 deletions(-) diff --git a/ports/espressif/common-hal/wifi/Network.c b/ports/espressif/common-hal/wifi/Network.c index 34cb15d603..5c9852a1f7 100644 --- a/ports/espressif/common-hal/wifi/Network.c +++ b/ports/espressif/common-hal/wifi/Network.c @@ -55,31 +55,31 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) { } mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { - uint8_t authmode_mask = 0; + uint32_t authmode_mask = 0; switch (self->record.authmode) { case WIFI_AUTH_OPEN: - authmode_mask = (1 << AUTHMODE_OPEN); + authmode_mask = AUTHMODE_OPEN; break; case WIFI_AUTH_WEP: - authmode_mask = (1 << AUTHMODE_WEP); + authmode_mask = AUTHMODE_WEP; break; case WIFI_AUTH_WPA_PSK: - authmode_mask = (1 << AUTHMODE_WPA) | (1 << AUTHMODE_PSK); + authmode_mask = AUTHMODE_WPA | AUTHMODE_PSK; break; case WIFI_AUTH_WPA2_PSK: - authmode_mask = (1 << AUTHMODE_WPA2) | (1 << AUTHMODE_PSK); + authmode_mask = AUTHMODE_WPA2 | AUTHMODE_PSK; break; case WIFI_AUTH_WPA_WPA2_PSK: - authmode_mask = (1 << AUTHMODE_WPA) | (1 << AUTHMODE_WPA2) | (1 << AUTHMODE_PSK); + authmode_mask = AUTHMODE_WPA | AUTHMODE_WPA2 | AUTHMODE_PSK; break; case WIFI_AUTH_WPA2_ENTERPRISE: - authmode_mask = (1 << AUTHMODE_WPA2) | (1 << AUTHMODE_ENTERPRISE); + authmode_mask = AUTHMODE_WPA2 | AUTHMODE_ENTERPRISE; break; case WIFI_AUTH_WPA3_PSK: - authmode_mask = (1 << AUTHMODE_WPA3) | (1 << AUTHMODE_PSK); + authmode_mask = AUTHMODE_WPA3 | AUTHMODE_PSK; break; case WIFI_AUTH_WPA2_WPA3_PSK: - authmode_mask = (1 << AUTHMODE_WPA2) | (1 << AUTHMODE_WPA3) | (1 << AUTHMODE_PSK); + authmode_mask = AUTHMODE_WPA2 | AUTHMODE_WPA3 | AUTHMODE_PSK; break; default: break; diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index 27e2c8c610..acd6ae53bc 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -205,20 +205,21 @@ void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) { set_mode_station(self, false); } -void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections) { +void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint32_t authmodes, uint8_t max_connections) { set_mode_ap(self, true); - switch (authmode) { - case (1 << AUTHMODE_OPEN): + uint8_t authmode = 0; + switch (authmodes) { + case AUTHMODE_OPEN: authmode = WIFI_AUTH_OPEN; break; - case ((1 << AUTHMODE_WPA) | (1 << AUTHMODE_PSK)): + case AUTHMODE_WPA | AUTHMODE_PSK: authmode = WIFI_AUTH_WPA_PSK; break; - case ((1 << AUTHMODE_WPA2) | (1 << AUTHMODE_PSK)): + case AUTHMODE_WPA2 | AUTHMODE_PSK: authmode = WIFI_AUTH_WPA2_PSK; break; - case ((1 << AUTHMODE_WPA) | (1 << AUTHMODE_WPA2) | (1 << AUTHMODE_PSK)): + case AUTHMODE_WPA | AUTHMODE_WPA2 | AUTHMODE_PSK: authmode = WIFI_AUTH_WPA_WPA2_PSK; break; default: diff --git a/ports/raspberrypi/common-hal/wifi/Network.c b/ports/raspberrypi/common-hal/wifi/Network.c index 8db42e962c..e9b64ffd2c 100644 --- a/ports/raspberrypi/common-hal/wifi/Network.c +++ b/ports/raspberrypi/common-hal/wifi/Network.c @@ -55,18 +55,18 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) { mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { uint8_t authmode_mask = 0; if (self->record.auth_mode == 0) { - authmode_mask = (1 << AUTHMODE_OPEN); + authmode_mask = AUTHMODE_OPEN; } if (self->record.auth_mode & 1) { - authmode_mask |= (1 << AUTHMODE_PSK); + authmode_mask |= AUTHMODE_PSK; } ; if (self->record.auth_mode & 2) { - authmode_mask |= (1 << AUTHMODE_WPA); + authmode_mask |= AUTHMODE_WPA; } ; if (self->record.auth_mode & 4) { - authmode_mask |= (1 << AUTHMODE_WPA2); + authmode_mask |= AUTHMODE_WPA2; } ; mp_obj_t authmode_list = mp_obj_new_list(0, NULL); diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 2a74c16e0a..a4df1d22d6 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -164,7 +164,7 @@ void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) { bindings_cyw43_wifi_enforce_pm(); } -void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections) { +void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint32_t authmodes, uint8_t max_connections) { mp_raise_NotImplementedError(NULL); bindings_cyw43_wifi_enforce_pm(); } diff --git a/shared-bindings/wifi/AuthMode.h b/shared-bindings/wifi/AuthMode.h index a1016d6c8a..c514fb2a32 100644 --- a/shared-bindings/wifi/AuthMode.h +++ b/shared-bindings/wifi/AuthMode.h @@ -30,13 +30,13 @@ #include "py/enum.h" typedef enum { - AUTHMODE_OPEN, - AUTHMODE_WEP, - AUTHMODE_WPA, - AUTHMODE_WPA2, - AUTHMODE_WPA3, - AUTHMODE_PSK, - AUTHMODE_ENTERPRISE + AUTHMODE_OPEN = 1 << 0, + AUTHMODE_WEP = 1 << 1, + AUTHMODE_WPA = 1 << 2, + AUTHMODE_WPA2 = 1 << 3, + AUTHMODE_WPA3 = 1 << 4, + AUTHMODE_PSK = 1 << 5, + AUTHMODE_ENTERPRISE = 1 << 6, } wifi_authmode_t; extern const mp_obj_type_t wifi_authmode_type; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 57e953ec68..37123dbb44 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -282,10 +282,10 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_station_obj, wifi_radio_stop_station); //| def start_ap( //| self, //| ssid: Union[str | ReadableBuffer], -//| password: Union[str | ReadableBuffer] = "", +//| password: Union[str | ReadableBuffer] = b"", //| *, -//| channel: Optional[int] = 1, -//| authmode: Optional[AuthMode], +//| channel: int = 1, +//| authmode: Optional[AuthMode] = None, //| max_connections: Optional[int] = 4 //| ) -> None: //| """Starts an Access Point with the specified ssid and password. @@ -293,10 +293,11 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_station_obj, wifi_radio_stop_station); //| If ``channel`` is given, the access point will use that channel unless //| a station is already operating on a different channel. //| -//| If ``authmode`` is given, the access point will use that Authentication -//| mode. If a password is given, ``authmode`` must not be ``OPEN``. -//| If ``authmode`` isn't given, ``OPEN`` will be used when password isn't provided, -//| otherwise ``WPA_WPA2_PSK``. +//| If ``authmode`` is not None, the access point will use that Authentication +//| mode. If a non-empty password is given, ``authmode`` must not be ``OPEN``. +//| If ``authmode`` is not given or is None, +//| ``OPEN`` will be used when the password is the empty string, +//| otherwise ``authmode`` will be ``WPA_WPA2_PSK``. //| //| If ``max_connections`` is given, the access point will allow up to //| that number of stations to connect.""" @@ -305,9 +306,9 @@ STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_ enum { ARG_ssid, ARG_password, ARG_channel, ARG_authmode, ARG_max_connections }; static const mp_arg_t allowed_args[] = { { MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_password, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_password, MP_ARG_OBJ, {.u_obj = mp_const_empty_bytes} }, { MP_QSTR_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, - { MP_QSTR_authmode, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_authmode, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none } }, { MP_QSTR_max_connections, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 4} }, }; @@ -315,12 +316,13 @@ STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - uint8_t authmode = 0; - if (args[ARG_authmode].u_obj != MP_OBJ_NULL) { + // 0 indicates mode wasn't given. + uint32_t authmodes = 0; + if (args[ARG_authmode].u_obj != mp_const_none) { mp_obj_iter_buf_t iter_buf; mp_obj_t item, iterable = mp_getiter(args[ARG_authmode].u_obj, &iter_buf); while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { - authmode |= (1 << (wifi_authmode_t)cp_enum_value(&wifi_authmode_type, item)); + authmodes |= cp_enum_value(&wifi_authmode_type, item); } } @@ -329,20 +331,24 @@ STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_ mp_arg_validate_length_range(ssid.len, 1, 32, MP_QSTR_ssid); mp_buffer_info_t password; - password.len = 0; - if (args[ARG_password].u_obj != MP_OBJ_NULL) { - if (authmode == 1) { - mp_raise_ValueError(translate("AuthMode.OPEN is not used with password")); - } else if (authmode == 0) { - authmode = (1 << AUTHMODE_WPA) | (1 << AUTHMODE_WPA2) | (1 << AUTHMODE_PSK); + mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); + if (authmodes == 0) { + if (password.len == 0) { + authmodes = AUTHMODE_OPEN; + } else { + authmodes = AUTHMODE_WPA | AUTHMODE_WPA2 | AUTHMODE_PSK; } - mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); - mp_arg_validate_length_range(password.len, 8, 63, MP_QSTR_password); - } else { - authmode = 1; } - common_hal_wifi_radio_start_ap(self, ssid.buf, ssid.len, password.buf, password.len, args[ARG_channel].u_int, authmode, args[ARG_max_connections].u_int); + if (authmodes == AUTHMODE_OPEN && password.len > 0) { + mp_raise_ValueError(translate("AuthMode.OPEN is not used with password")); + } + + if (authmodes != AUTHMODE_OPEN) { + mp_arg_validate_length_range(password.len, 8, 63, MP_QSTR_password); + } + + common_hal_wifi_radio_start_ap(self, ssid.buf, ssid.len, password.buf, password.len, args[ARG_channel].u_int, authmodes, args[ARG_max_connections].u_int); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_start_ap_obj, 1, wifi_radio_start_ap); @@ -359,10 +365,10 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_ap_obj, wifi_radio_stop_ap); //| def connect( //| self, //| ssid: Union[str | ReadableBuffer], -//| password: Union[str | ReadableBuffer] = "", +//| password: Union[str | ReadableBuffer] = b"", //| *, -//| channel: Optional[int] = 0, -//| bssid: Optional[Union[str | ReadableBuffer]] = "", +//| channel: int = 0, +//| bssid: Optional[Union[str | ReadableBuffer]] = None, //| timeout: Optional[float] = None //| ) -> None: //| """Connects to the given ssid and waits for an ip address. Reconnections are handled @@ -371,20 +377,20 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_ap_obj, wifi_radio_stop_ap); //| By default, this will scan all channels and connect to the access point (AP) with the //| given ``ssid`` and greatest signal strength (rssi). //| -//| If ``channel`` is given, the scan will begin with the given channel and connect to +//| If ``channel`` is non-zero, the scan will begin with the given channel and connect to //| the first AP with the given ``ssid``. This can speed up the connection time //| significantly because a full scan doesn't occur. //| -//| If ``bssid`` is given, the scan will start at the first channel or the one given and +//| If ``bssid`` is given and not None, the scan will start at the first channel or the one given and //| connect to the AP with the given ``bssid`` and ``ssid``.""" //| ... STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_ssid, ARG_password, ARG_channel, ARG_bssid, ARG_timeout }; static const mp_arg_t allowed_args[] = { { MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_password, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_password, MP_ARG_OBJ, {.u_obj = mp_const_empty_bytes} }, { MP_QSTR_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_bssid, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_bssid, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, }; @@ -404,9 +410,11 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m mp_buffer_info_t password; password.len = 0; - if (args[ARG_password].u_obj != MP_OBJ_NULL) { + if (args[ARG_password].u_obj != mp_const_none) { mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); - mp_arg_validate_length_range(password.len, 8, 63, MP_QSTR_password); + if (password.len != 0) { + mp_arg_validate_length_range(password.len, 8, 63, MP_QSTR_password); + } } #define MAC_ADDRESS_LENGTH 6 @@ -414,7 +422,7 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m mp_buffer_info_t bssid; bssid.len = 0; // Should probably make sure bssid is just bytes and not something else too - if (args[ARG_bssid].u_obj != MP_OBJ_NULL) { + if (args[ARG_bssid].u_obj != mp_const_none) { mp_get_buffer_raise(args[ARG_bssid].u_obj, &bssid, MP_BUFFER_READ); if (bssid.len != MAC_ADDRESS_LENGTH) { mp_raise_ValueError(translate("Invalid BSSID")); diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 370bdbd917..407443c77e 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -91,7 +91,7 @@ extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) extern void common_hal_wifi_radio_start_station(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self); -extern void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections); +extern void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint32_t authmodes, uint8_t max_connections); extern void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_start_dhcp_client(wifi_radio_obj_t *self); From e5ea1d224758dc067359a24cc0ea2a1b15e26dfb Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 22 Nov 2022 18:47:25 -0600 Subject: [PATCH 143/357] try to revert pixelbuf merge brokenness. remove second color_u def. --- shared-module/adafruit_pixelbuf/PixelBuf.c | 67 +++++++++++++--------- shared-module/adafruit_pixelmap/PixelMap.c | 6 -- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index 5017ba2f2c..ca8f1c05b0 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -154,56 +154,55 @@ STATIC uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { translate("can't convert %q to %q"), mp_obj_get_type_qstr(obj), MP_QSTR_int); } -STATIC color_u _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color) { - color_u result; +static void pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w) { pixelbuf_byteorder_details_t *byteorder = &self->byteorder; // w is shared between white in NeoPixels and brightness in dotstars (so that DotStars can have // per-pixel brightness). Set the defaults here in case it isn't set below. if (byteorder->is_dotstar) { - result.w = 255; + *w = 255; } else { - result.w = 0; + *w = 0; } if (mp_obj_is_int(color) || mp_obj_is_float(color)) { mp_int_t value = mp_obj_is_int(color) ? mp_obj_get_int_truncated(color) : (mp_int_t)mp_obj_get_float(color); - result.r = value >> 16 & 0xff; - result.g = (value >> 8) & 0xff; - result.b = value & 0xff; + *r = value >> 16 & 0xff; + *g = (value >> 8) & 0xff; + *b = value & 0xff; } else { mp_obj_t *items; size_t len; mp_obj_get_array(color, &len, &items); mp_arg_validate_length_range(len, 3, 4, MP_QSTR_color); - result.r = _pixelbuf_get_as_uint8(items[PIXEL_R]); - result.g = _pixelbuf_get_as_uint8(items[PIXEL_G]); - result.b = _pixelbuf_get_as_uint8(items[PIXEL_B]); + *r = _pixelbuf_get_as_uint8(items[PIXEL_R]); + *g = _pixelbuf_get_as_uint8(items[PIXEL_G]); + *b = _pixelbuf_get_as_uint8(items[PIXEL_B]); if (len > 3) { if (mp_obj_is_float(items[PIXEL_W])) { - result.w = 255 * mp_obj_get_float(items[PIXEL_W]); + *w = 255 * mp_obj_get_float(items[PIXEL_W]); } else { - result.w = mp_obj_get_int_truncated(items[PIXEL_W]); + *w = mp_obj_get_int_truncated(items[PIXEL_W]); } - return result; + return; } } // Int colors can't set white directly so convert to white when all components are equal. // Also handles RGBW values assigned an RGB tuple. - if (!byteorder->is_dotstar && byteorder->bpp == 4 && byteorder->has_white && result.r == result.g && result.r == result.b) { - result.w = result.r; - result.r = 0; - result.g = 0; - result.b = 0; + if (!byteorder->is_dotstar && byteorder->bpp == 4 && byteorder->has_white && *r == *g && *r == *b) { + *w = *r; + *r = 0; + *g = 0; + *b = 0; } - return result; } -STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, color_u rgbw) { - uint8_t r = rgbw.r; - uint8_t g = rgbw.g; - uint8_t b = rgbw.b; - uint8_t w = rgbw.w; +void common_hal_adafruit_pixelbuf_pixelbuf_parse_color(mp_obj_t self_in, mp_obj_t color, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *w) { + pixelbuf_pixelbuf_obj_t *self = native_pixelbuf(self_in); + pixelbuf_parse_color(self, color, r, g, b, w); +} + +static void pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { // DotStars don't have white, instead they have 5 bit brightness so pack it into w. Shift right // by three to leave the top five bits. if (self->bytes_per_pixel == 4 && self->byteorder.is_dotstar) { @@ -240,10 +239,18 @@ STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t inde scaled_buffer[rgbw_order->b] = (b * self->scaled_brightness) / 256; } } +void common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(mp_obj_t self_in, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { + pixelbuf_pixelbuf_obj_t *self = native_pixelbuf(self_in); + pixelbuf_set_pixel_color(self, index, r, g, b, w); +} STATIC void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t *self, size_t index, mp_obj_t value) { - color_u rgbw = _pixelbuf_parse_color(self, value); - _pixelbuf_set_pixel_color(self, index, rgbw); + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t w; + common_hal_adafruit_pixelbuf_pixelbuf_parse_color(self, value, &r, &g, &b, &w); + common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(self, index, r, g, b, w); } void common_hal_adafruit_pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t *values, @@ -322,10 +329,14 @@ void common_hal_adafruit_pixelbuf_pixelbuf_show(mp_obj_t self_in) { void common_hal_adafruit_pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t fill_color) { pixelbuf_pixelbuf_obj_t *self = native_pixelbuf(self_in); - color_u rgbw = _pixelbuf_parse_color(self, fill_color); + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t w; + common_hal_adafruit_pixelbuf_pixelbuf_parse_color(self, fill_color, &r, &g, &b, &w); for (size_t i = 0; i < self->pixel_count; i++) { - _pixelbuf_set_pixel_color(self, i, rgbw); + common_hal_adafruit_pixelbuf_pixelbuf_set_pixel_color(self, i, r, g, b, w); } if (self->auto_write) { common_hal_adafruit_pixelbuf_pixelbuf_show(self_in); diff --git a/shared-module/adafruit_pixelmap/PixelMap.c b/shared-module/adafruit_pixelmap/PixelMap.c index 6897b172af..f2c73c7a61 100644 --- a/shared-module/adafruit_pixelmap/PixelMap.c +++ b/shared-module/adafruit_pixelmap/PixelMap.c @@ -32,12 +32,6 @@ #include "shared-bindings/adafruit_pixelbuf/PixelBuf.h" #include "shared-module/adafruit_pixelmap/PixelMap.h" -typedef union { - uint32_t rgbw; - struct { - uint8_t r, g, b, w; - }; -} color_u; static void pixelmap_set_pixel_rgbw(pixelmap_pixelmap_obj_t *self, size_t i, color_u rgbw) { mp_arg_validate_index_range(i, 0, self->len, MP_QSTR_index); From 79f434486044d5de1ae3378c397a10fedfce81c1 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 23 Nov 2022 22:11:41 -0500 Subject: [PATCH 144/357] fix playing mono files on stereo output --- ports/atmel-samd/common-hal/audioio/AudioOut.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index a565a77042..7007672b3f 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -405,7 +405,13 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t *self, if (self->right_channel == &pin_PA02) { right_channel_reg = (uint32_t)&DAC->DATABUF[0].reg; } - if (right_channel_reg == left_channel_reg + 2 && audiosample_bits_per_sample(sample) == 16) { + + size_t num_channels = audiosample_channel_count(sample); + + if (num_channels == 2 && + // Are DAC channels sequential? + left_channel_reg + 2 == right_channel_reg && + audiosample_bits_per_sample(sample) == 16) { result = audio_dma_setup_playback(&self->left_dma, sample, loop, false, 0, false /* output unsigned */, left_channel_reg, @@ -415,7 +421,11 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t *self, false /* output unsigned */, left_channel_reg, left_channel_trigger); - if (right_channel_reg != 0 && result == AUDIO_DMA_OK) { + // Don't play back on right channel unless stereo. + // TODO possibility: Set up non-incrementing DMA on one channel so they use the same samples? + // Right now, playing back mono on both channels causes sample to play twice as fast. + if (num_channels == 2 && + right_channel_reg != 0 && result == AUDIO_DMA_OK) { result = audio_dma_setup_playback(&self->right_dma, sample, loop, true, 1, false /* output unsigned */, right_channel_reg, From c0b57ff8c5901fb177d6532b085a16792e7d1774 Mon Sep 17 00:00:00 2001 From: Jeffrey Shimbo <16313374+jshimbo@users.noreply.github.com> Date: Thu, 24 Nov 2022 06:05:46 -0800 Subject: [PATCH 145/357] Typo in docs for supervisor.ticks_ms() https://docs.circuitpython.org/en/latest/shared-bindings/supervisor/index.html#supervisor.ticks_ms ticks_add() helper function has an error --- shared-bindings/supervisor/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index b61d05d636..37f35e2e18 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -197,7 +197,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(supervisor_set_next_code_file_obj, 0, supervisor_set_ //| //| def ticks_add(ticks, delta): //| "Add a delta to a base number of ticks, performing wraparound at 2**29ms." -//| return (a + b) % _TICKS_PERIOD +//| return (ticks + delta) % _TICKS_PERIOD //| //| def ticks_diff(ticks1, ticks2): //| "Compute the signed difference between two ticks values, assuming that they are within 2**28 ticks" From 57d7f7f2adce8008690f6efd865d0994d4e52143 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Thu, 24 Nov 2022 09:07:08 -0600 Subject: [PATCH 146/357] move to _pixelmap --- py/circuitpy_defns.mk | 6 +++--- .../{adafruit_pixelmap => _pixelmap}/PixelMap.c | 4 ++-- .../{adafruit_pixelmap => _pixelmap}/PixelMap.h | 0 .../{adafruit_pixelmap => _pixelmap}/__init__.c | 10 +++++----- .../{adafruit_pixelmap => _pixelmap}/__init__.h | 0 .../{adafruit_pixelmap => _pixelmap}/PixelMap.c | 4 ++-- .../{adafruit_pixelmap => _pixelmap}/PixelMap.h | 0 .../{adafruit_pixelmap => _pixelmap}/__init__.c | 0 8 files changed, 12 insertions(+), 12 deletions(-) rename shared-bindings/{adafruit_pixelmap => _pixelmap}/PixelMap.c (98%) rename shared-bindings/{adafruit_pixelmap => _pixelmap}/PixelMap.h (100%) rename shared-bindings/{adafruit_pixelmap => _pixelmap}/__init__.c (85%) rename shared-bindings/{adafruit_pixelmap => _pixelmap}/__init__.h (100%) rename shared-module/{adafruit_pixelmap => _pixelmap}/PixelMap.c (98%) rename shared-module/{adafruit_pixelmap => _pixelmap}/PixelMap.h (100%) rename shared-module/{adafruit_pixelmap => _pixelmap}/__init__.c (100%) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 0d70068e43..70310106f0 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -267,7 +267,7 @@ ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += adafruit_pixelbuf/% endif ifeq ($(CIRCUITPY_PIXELMAP),1) -SRC_PATTERNS += adafruit_pixelmap/% +SRC_PATTERNS += _pixelmap/% endif ifeq ($(CIRCUITPY_QRIO),1) SRC_PATTERNS += qrio/% @@ -546,8 +546,8 @@ SRC_SHARED_MODULE_ALL = \ _eve/__init__.c \ adafruit_pixelbuf/PixelBuf.c \ adafruit_pixelbuf/__init__.c \ - adafruit_pixelmap/PixelMap.c \ - adafruit_pixelmap/__init__.c \ + _pixelmap/PixelMap.c \ + _pixelmap/__init__.c \ _stage/Layer.c \ _stage/Text.c \ _stage/__init__.c \ diff --git a/shared-bindings/adafruit_pixelmap/PixelMap.c b/shared-bindings/_pixelmap/PixelMap.c similarity index 98% rename from shared-bindings/adafruit_pixelmap/PixelMap.c rename to shared-bindings/_pixelmap/PixelMap.c index 3361534ca1..c5f7e0ddb5 100644 --- a/shared-bindings/adafruit_pixelmap/PixelMap.c +++ b/shared-bindings/_pixelmap/PixelMap.c @@ -29,9 +29,9 @@ #include "py/objtype.h" #include "py/runtime.h" -#include "shared-bindings/adafruit_pixelmap/PixelMap.h" +#include "shared-bindings/_pixelmap/PixelMap.h" #include "shared-bindings/adafruit_pixelbuf/PixelBuf.h" -#include "shared-module/adafruit_pixelmap/PixelMap.h" +#include "shared-module/_pixelmap/PixelMap.h" //| from adafruit_pixelbuf import PixelBuf, PixelReturnType, PixelSequence, PixelType //| diff --git a/shared-bindings/adafruit_pixelmap/PixelMap.h b/shared-bindings/_pixelmap/PixelMap.h similarity index 100% rename from shared-bindings/adafruit_pixelmap/PixelMap.h rename to shared-bindings/_pixelmap/PixelMap.h diff --git a/shared-bindings/adafruit_pixelmap/__init__.c b/shared-bindings/_pixelmap/__init__.c similarity index 85% rename from shared-bindings/adafruit_pixelmap/__init__.c rename to shared-bindings/_pixelmap/__init__.c index 7b10471c83..13a09d69d2 100644 --- a/shared-bindings/adafruit_pixelmap/__init__.c +++ b/shared-bindings/_pixelmap/__init__.c @@ -29,13 +29,13 @@ #include "py/runtime.h" #include "py/objproperty.h" -#include "shared-bindings/adafruit_pixelmap/__init__.h" -#include "shared-bindings/adafruit_pixelmap/PixelMap.h" +#include "shared-bindings/_pixelmap/__init__.h" +#include "shared-bindings/_pixelmap/PixelMap.h" //| """A fast pixel mapping library //| -//| The `adafruit_pixelmap` module provides the :py:class:`PixelMap` class to accelerate +//| The `_pixelmap` module provides the :py:class:`PixelMap` class to accelerate //| RGB(W) strip/matrix manipulation, such as DotStar and Neopixel.""" //| //| # The types accepted when getting a pixel value @@ -48,7 +48,7 @@ //| PixelSequence = Union[Tuple[PixelType], List[PixelType]] STATIC const mp_rom_map_elem_t pixelmap_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_adafruit_pixelmap) }, + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__pixelmap) }, { MP_ROM_QSTR(MP_QSTR_PixelMap), MP_ROM_PTR(&pixelmap_pixelmap_type) }, }; @@ -59,4 +59,4 @@ const mp_obj_module_t pixelmap_module = { .globals = (mp_obj_dict_t *)&pixelmap_module_globals, }; -MP_REGISTER_MODULE(MP_QSTR_adafruit_pixelmap, pixelmap_module, CIRCUITPY_PIXELMAP); +MP_REGISTER_MODULE(MP_QSTR__pixelmap, pixelmap_module, CIRCUITPY_PIXELMAP); diff --git a/shared-bindings/adafruit_pixelmap/__init__.h b/shared-bindings/_pixelmap/__init__.h similarity index 100% rename from shared-bindings/adafruit_pixelmap/__init__.h rename to shared-bindings/_pixelmap/__init__.h diff --git a/shared-module/adafruit_pixelmap/PixelMap.c b/shared-module/_pixelmap/PixelMap.c similarity index 98% rename from shared-module/adafruit_pixelmap/PixelMap.c rename to shared-module/_pixelmap/PixelMap.c index f2c73c7a61..d20a6dd03c 100644 --- a/shared-module/adafruit_pixelmap/PixelMap.c +++ b/shared-module/_pixelmap/PixelMap.c @@ -28,9 +28,9 @@ #include "py/smallint.h" #include "py/runtime.h" -#include "shared-bindings/adafruit_pixelmap/PixelMap.h" +#include "shared-bindings/_pixelmap/PixelMap.h" #include "shared-bindings/adafruit_pixelbuf/PixelBuf.h" -#include "shared-module/adafruit_pixelmap/PixelMap.h" +#include "shared-module/_pixelmap/PixelMap.h" static void pixelmap_set_pixel_rgbw(pixelmap_pixelmap_obj_t *self, size_t i, color_u rgbw) { diff --git a/shared-module/adafruit_pixelmap/PixelMap.h b/shared-module/_pixelmap/PixelMap.h similarity index 100% rename from shared-module/adafruit_pixelmap/PixelMap.h rename to shared-module/_pixelmap/PixelMap.h diff --git a/shared-module/adafruit_pixelmap/__init__.c b/shared-module/_pixelmap/__init__.c similarity index 100% rename from shared-module/adafruit_pixelmap/__init__.c rename to shared-module/_pixelmap/__init__.c From c6ca2bdd596bb52226e4d20c135861d8853104c2 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Thu, 24 Nov 2022 09:09:48 -0600 Subject: [PATCH 147/357] disable pixelmap on bluemicro833 --- ports/nrf/boards/bluemicro833/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/boards/bluemicro833/mpconfigboard.mk b/ports/nrf/boards/bluemicro833/mpconfigboard.mk index 6108f23102..9b230e9a53 100644 --- a/ports/nrf/boards/bluemicro833/mpconfigboard.mk +++ b/ports/nrf/boards/bluemicro833/mpconfigboard.mk @@ -13,4 +13,5 @@ CIRCUITPY_KEYPAD = 1 CIRCUITPY_NVM = 0 CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PIXELBUF = 1 +CIRCUITPY_PIXELMAP = 0 CIRCUITPY_TOUCHIO = 0 From fb46e7c4d8e044fc577dd588f200331a6236e03d Mon Sep 17 00:00:00 2001 From: m1cha1s Date: Fri, 25 Nov 2022 12:13:44 +0100 Subject: [PATCH 148/357] Defined esp32 board for the esp32 devkit v1 --- .../espressif/boards/esp32_devkit_v1/board.c | 29 +++++++++ .../boards/esp32_devkit_v1/mpconfigboard.h | 60 +++++++++++++++++++ .../boards/esp32_devkit_v1/mpconfigboard.mk | 9 +++ ports/espressif/boards/esp32_devkit_v1/pins.c | 45 ++++++++++++++ .../boards/esp32_devkit_v1/sdkconfig | 20 +++++++ 5 files changed, 163 insertions(+) create mode 100644 ports/espressif/boards/esp32_devkit_v1/board.c create mode 100644 ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h create mode 100644 ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk create mode 100644 ports/espressif/boards/esp32_devkit_v1/pins.c create mode 100644 ports/espressif/boards/esp32_devkit_v1/sdkconfig diff --git a/ports/espressif/boards/esp32_devkit_v1/board.c b/ports/espressif/boards/esp32_devkit_v1/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/esp32_devkit_v1/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h new file mode 100644 index 0000000000..4ac75b3651 --- /dev/null +++ b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert 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 "ESP32 Devkit V1" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN \ + { \ + { \ + .scl = &pin_GPIO22, .sda = &pin_GPIO21 \ + } \ + } + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN \ + { \ + { \ + .clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19 \ + } \ + } + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN \ + { \ + { \ + .tx = &pin_GPIO17, .rx = &pin_GPIO16 \ + } \ + } + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk new file mode 100644 index 0000000000..221543547c --- /dev/null +++ b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk @@ -0,0 +1,9 @@ +CIRCUITPY_CREATOR_ID = 0x0000239A +CIRCUITPY_CREATION_ID = 0x00320002 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/esp32_devkit_v1/pins.c b/ports/espressif/boards/esp32_devkit_v1/pins.c new file mode 100644 index 0000000000..b300f8a80a --- /dev/null +++ b/ports/espressif/boards/esp32_devkit_v1/pins.c @@ -0,0 +1,45 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, left side, then right side + {MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15)}, + {MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2)}, + {MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO16)}, + {MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO17)}, + {MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5)}, + {MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18)}, + {MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19)}, + {MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21)}, + {MP_ROM_QSTR(MP_QSTR_RX0), MP_ROM_PTR(&pin_GPIO1)}, + {MP_ROM_QSTR(MP_QSTR_TX0), MP_ROM_PTR(&pin_GPIO3)}, + {MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22)}, + {MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23)}, + {MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13)}, + {MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12)}, + {MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14)}, + {MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27)}, + {MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26)}, + {MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25)}, + {MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33)}, + {MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32)}, + {MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35)}, + {MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34)}, + + {MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2)}, + + {MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO21)}, + {MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO22)}, + + {MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18)}, + {MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23)}, + {MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19)}, + + {MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO17)}, + {MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO16)}, + + {MP_ROM_QSTR(MP_QSTR_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/esp32_devkit_v1/sdkconfig b/ports/espressif/boards/esp32_devkit_v1/sdkconfig new file mode 100644 index 0000000000..6c0168c829 --- /dev/null +++ b/ports/espressif/boards/esp32_devkit_v1/sdkconfig @@ -0,0 +1,20 @@ +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_SPIRAM_SUPPORT=n + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings From 26fbb25653f78335ff5b4c70194b08f98492fb0c Mon Sep 17 00:00:00 2001 From: m1cha1s Date: Fri, 25 Nov 2022 13:55:06 +0100 Subject: [PATCH 149/357] Fixed formatting --- .../boards/esp32_devkit_v1/mpconfigboard.h | 29 +- ports/espressif/boards/esp32_devkit_v1/pins.c | 3 +- uncrustify.cfg | 3128 +++++++++++++++++ 3 files changed, 3137 insertions(+), 23 deletions(-) create mode 100644 uncrustify.cfg diff --git a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h index 4ac75b3651..2a0dcd0104 100644 --- a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h +++ b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h @@ -29,31 +29,16 @@ #define MICROPY_HW_BOARD_NAME "ESP32 Devkit V1" #define MICROPY_HW_MCU_NAME "ESP32" -#define MICROPY_HW_LED_STATUS (&pin_GPIO2) +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) -#define CIRCUITPY_BOARD_I2C (1) -#define CIRCUITPY_BOARD_I2C_PIN \ - { \ - { \ - .scl = &pin_GPIO22, .sda = &pin_GPIO21 \ - } \ - } +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO22, .sda = &pin_GPIO21}} -#define CIRCUITPY_BOARD_SPI (1) -#define CIRCUITPY_BOARD_SPI_PIN \ - { \ - { \ - .clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19 \ - } \ - } +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} -#define CIRCUITPY_BOARD_UART (1) -#define CIRCUITPY_BOARD_UART_PIN \ - { \ - { \ - .tx = &pin_GPIO17, .rx = &pin_GPIO16 \ - } \ - } +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO17, .rx = &pin_GPIO16}} // UART pins attached to the USB-serial converter chip #define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) diff --git a/ports/espressif/boards/esp32_devkit_v1/pins.c b/ports/espressif/boards/esp32_devkit_v1/pins.c index b300f8a80a..78c37897ac 100644 --- a/ports/espressif/boards/esp32_devkit_v1/pins.c +++ b/ports/espressif/boards/esp32_devkit_v1/pins.c @@ -41,5 +41,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_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_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/uncrustify.cfg b/uncrustify.cfg new file mode 100644 index 0000000000..63e22e9391 --- /dev/null +++ b/uncrustify.cfg @@ -0,0 +1,3128 @@ +# Uncrustify-0.72.0_f + +# +# General options +# + +# The type of line endings. +# +# Default: auto +newlines = auto # lf/crlf/cr/auto + +# The original size of tabs in the input. +# +# Default: 8 +input_tab_size = 8 # unsigned number + +# The size of tabs in the output (only used if align_with_tabs=true). +# +# Default: 8 +output_tab_size = 8 # unsigned number + +# The ASCII value of the string escape char, usually 92 (\) or (Pawn) 94 (^). +# +# Default: 92 +string_escape_char = 92 # unsigned number + +# Alternate string escape char (usually only used for Pawn). +# Only works right before the quote char. +string_escape_char2 = 0 # unsigned number + +# Replace tab characters found in string literals with the escape sequence \t +# instead. +string_replace_tab_chars = false # true/false + +# Allow interpreting '>=' and '>>=' as part of a template in code like +# 'void f(list>=val);'. If true, 'assert(x<0 && y>=3)' will be broken. +# Improvements to template detection may make this option obsolete. +tok_split_gte = false # true/false + +# Disable formatting of NL_CONT ('\\n') ended lines (e.g. multiline macros) +disable_processing_nl_cont = false # true/false + +# Specify the marker used in comments to disable processing of part of the +# file. +# The comment should be used alone in one line. +# +# Default: *INDENT-OFF* +disable_processing_cmt = " *INDENT-OFF*" # string + +# Specify the marker used in comments to (re)enable processing in a file. +# The comment should be used alone in one line. +# +# Default: *INDENT-ON* +enable_processing_cmt = " *INDENT-ON*" # string + +# Enable parsing of digraphs. +enable_digraphs = false # true/false + +# Add or remove the UTF-8 BOM (recommend 'remove'). +utf8_bom = ignore # ignore/add/remove/force + +# If the file contains bytes with values between 128 and 255, but is not +# UTF-8, then output as UTF-8. +utf8_byte = false # true/false + +# Force the output encoding to UTF-8. +utf8_force = false # true/false + +# Add or remove space between 'do' and '{'. +sp_do_brace_open = ignore # ignore/add/remove/force + +# Add or remove space between '}' and 'while'. +sp_brace_close_while = ignore # ignore/add/remove/force + +# Add or remove space between 'while' and '('. +sp_while_paren_open = ignore # ignore/add/remove/force + +# +# Spacing options +# + +# Add or remove space around non-assignment symbolic operators ('+', '/', '%', +# '<<', and so forth). +sp_arith = ignore # ignore/add/remove/force + +# Add or remove space around arithmetic operators '+' and '-'. +# +# Overrides sp_arith. +sp_arith_additive = ignore # ignore/add/remove/force + +# Add or remove space around assignment operator '=', '+=', etc. +sp_assign = ignore # ignore/add/remove/force + +# Add or remove space around '=' in C++11 lambda capture specifications. +# +# Overrides sp_assign. +sp_cpp_lambda_assign = ignore # ignore/add/remove/force + +# Add or remove space after the capture specification of a C++11 lambda when +# an argument list is present, as in '[] (int x){ ... }'. +sp_cpp_lambda_square_paren = ignore # ignore/add/remove/force + +# Add or remove space after the capture specification of a C++11 lambda with +# no argument list is present, as in '[] { ... }'. +sp_cpp_lambda_square_brace = ignore # ignore/add/remove/force + +# Add or remove space after the argument list of a C++11 lambda, as in +# '[](int x) { ... }'. +sp_cpp_lambda_paren_brace = ignore # ignore/add/remove/force + +# Add or remove space between a lambda body and its call operator of an +# immediately invoked lambda, as in '[]( ... ){ ... } ( ... )'. +sp_cpp_lambda_fparen = ignore # ignore/add/remove/force + +# Add or remove space around assignment operator '=' in a prototype. +# +# If set to ignore, use sp_assign. +sp_assign_default = ignore # ignore/add/remove/force + +# Add or remove space before assignment operator '=', '+=', etc. +# +# Overrides sp_assign. +sp_before_assign = ignore # ignore/add/remove/force + +# Add or remove space after assignment operator '=', '+=', etc. +# +# Overrides sp_assign. +sp_after_assign = ignore # ignore/add/remove/force + +# Add or remove space in 'NS_ENUM ('. +sp_enum_paren = ignore # ignore/add/remove/force + +# Add or remove space around assignment '=' in enum. +sp_enum_assign = ignore # ignore/add/remove/force + +# Add or remove space before assignment '=' in enum. +# +# Overrides sp_enum_assign. +sp_enum_before_assign = ignore # ignore/add/remove/force + +# Add or remove space after assignment '=' in enum. +# +# Overrides sp_enum_assign. +sp_enum_after_assign = ignore # ignore/add/remove/force + +# Add or remove space around assignment ':' in enum. +sp_enum_colon = ignore # ignore/add/remove/force + +# Add or remove space around preprocessor '##' concatenation operator. +# +# Default: add +sp_pp_concat = add # ignore/add/remove/force + +# Add or remove space after preprocessor '#' stringify operator. +# Also affects the '#@' charizing operator. +sp_pp_stringify = ignore # ignore/add/remove/force + +# Add or remove space before preprocessor '#' stringify operator +# as in '#define x(y) L#y'. +sp_before_pp_stringify = ignore # ignore/add/remove/force + +# Add or remove space around boolean operators '&&' and '||'. +sp_bool = ignore # ignore/add/remove/force + +# Add or remove space around compare operator '<', '>', '==', etc. +sp_compare = ignore # ignore/add/remove/force + +# Add or remove space inside '(' and ')'. +sp_inside_paren = ignore # ignore/add/remove/force + +# Add or remove space between nested parentheses, i.e. '((' vs. ') )'. +sp_paren_paren = ignore # ignore/add/remove/force + +# Add or remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. +sp_cparen_oparen = ignore # ignore/add/remove/force + +# Whether to balance spaces inside nested parentheses. +sp_balance_nested_parens = false # true/false + +# Add or remove space between ')' and '{'. +sp_paren_brace = ignore # ignore/add/remove/force + +# Add or remove space between nested braces, i.e. '{{' vs '{ {'. +sp_brace_brace = ignore # ignore/add/remove/force + +# Add or remove space before pointer star '*'. +sp_before_ptr_star = ignore # ignore/add/remove/force + +# Add or remove space before pointer star '*' that isn't followed by a +# variable name. If set to ignore, sp_before_ptr_star is used instead. +sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force + +# Add or remove space between pointer stars '*'. +sp_between_ptr_star = ignore # ignore/add/remove/force + +# Add or remove space after pointer star '*', if followed by a word. +# +# Overrides sp_type_func. +sp_after_ptr_star = ignore # ignore/add/remove/force + +# Add or remove space after pointer caret '^', if followed by a word. +sp_after_ptr_block_caret = ignore # ignore/add/remove/force + +# Add or remove space after pointer star '*', if followed by a qualifier. +sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force + +# Add or remove space after a pointer star '*', if followed by a function +# prototype or function definition. +# +# Overrides sp_after_ptr_star and sp_type_func. +sp_after_ptr_star_func = ignore # ignore/add/remove/force + +# Add or remove space after a pointer star '*', if followed by an open +# parenthesis, as in 'void* (*)(). +sp_ptr_star_paren = ignore # ignore/add/remove/force + +# Add or remove space before a pointer star '*', if followed by a function +# prototype or function definition. +sp_before_ptr_star_func = ignore # ignore/add/remove/force + +# Add or remove space before a reference sign '&'. +sp_before_byref = ignore # ignore/add/remove/force + +# Add or remove space before a reference sign '&' that isn't followed by a +# variable name. If set to ignore, sp_before_byref is used instead. +sp_before_unnamed_byref = ignore # ignore/add/remove/force + +# Add or remove space after reference sign '&', if followed by a word. +# +# Overrides sp_type_func. +sp_after_byref = ignore # ignore/add/remove/force + +# Add or remove space after a reference sign '&', if followed by a function +# prototype or function definition. +# +# Overrides sp_after_byref and sp_type_func. +sp_after_byref_func = ignore # ignore/add/remove/force + +# Add or remove space before a reference sign '&', if followed by a function +# prototype or function definition. +sp_before_byref_func = ignore # ignore/add/remove/force + +# Add or remove space between type and word. In cases where total removal of +# whitespace would be a syntax error, a value of 'remove' is treated the same +# as 'force'. +# +# This also affects some other instances of space following a type that are +# not covered by other options; for example, between the return type and +# parenthesis of a function type template argument, between the type and +# parenthesis of an array parameter, or between 'decltype(...)' and the +# following word. +# +# Default: force +sp_after_type = force # ignore/add/remove/force + +# Add or remove space between 'decltype(...)' and word. +# +# Overrides sp_after_type. +sp_after_decltype = ignore # ignore/add/remove/force + +# (D) Add or remove space before the parenthesis in the D constructs +# 'template Foo(' and 'class Foo('. +sp_before_template_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'template' and '<'. +# If set to ignore, sp_before_angle is used. +sp_template_angle = ignore # ignore/add/remove/force + +# Add or remove space before '<'. +sp_before_angle = ignore # ignore/add/remove/force + +# Add or remove space inside '<' and '>'. +sp_inside_angle = ignore # ignore/add/remove/force + +# Add or remove space inside '<>'. +sp_inside_angle_empty = ignore # ignore/add/remove/force + +# Add or remove space between '>' and ':'. +sp_angle_colon = ignore # ignore/add/remove/force + +# Add or remove space after '>'. +sp_after_angle = ignore # ignore/add/remove/force + +# Add or remove space between '>' and '(' as found in 'new List(foo);'. +sp_angle_paren = ignore # ignore/add/remove/force + +# Add or remove space between '>' and '()' as found in 'new List();'. +sp_angle_paren_empty = ignore # ignore/add/remove/force + +# Add or remove space between '>' and a word as in 'List m;' or +# 'template static ...'. +sp_angle_word = ignore # ignore/add/remove/force + +# Add or remove space between '>' and '>' in '>>' (template stuff). +# +# Default: add +sp_angle_shift = add # ignore/add/remove/force + +# (C++11) Permit removal of the space between '>>' in 'foo >'. Note +# that sp_angle_shift cannot remove the space without this option. +sp_permit_cpp11_shift = false # true/false + +# Add or remove space before '(' of control statements ('if', 'for', 'switch', +# 'while', etc.). +sp_before_sparen = ignore # ignore/add/remove/force + +# Add or remove space inside '(' and ')' of control statements. +sp_inside_sparen = ignore # ignore/add/remove/force + +# Add or remove space after '(' of control statements. +# +# Overrides sp_inside_sparen. +sp_inside_sparen_open = ignore # ignore/add/remove/force + +# Add or remove space before ')' of control statements. +# +# Overrides sp_inside_sparen. +sp_inside_sparen_close = ignore # ignore/add/remove/force + +# Add or remove space after ')' of control statements. +sp_after_sparen = ignore # ignore/add/remove/force + +# Add or remove space between ')' and '{' of of control statements. +sp_sparen_brace = ignore # ignore/add/remove/force + +# (D) Add or remove space between 'invariant' and '('. +sp_invariant_paren = ignore # ignore/add/remove/force + +# (D) Add or remove space after the ')' in 'invariant (C) c'. +sp_after_invariant_paren = ignore # ignore/add/remove/force + +# Add or remove space before empty statement ';' on 'if', 'for' and 'while'. +sp_special_semi = ignore # ignore/add/remove/force + +# Add or remove space before ';'. +# +# Default: remove +sp_before_semi = remove # ignore/add/remove/force + +# Add or remove space before ';' in non-empty 'for' statements. +sp_before_semi_for = ignore # ignore/add/remove/force + +# Add or remove space before a semicolon of an empty part of a for statement. +sp_before_semi_for_empty = ignore # ignore/add/remove/force + +# Add or remove space after ';', except when followed by a comment. +# +# Default: add +sp_after_semi = add # ignore/add/remove/force + +# Add or remove space after ';' in non-empty 'for' statements. +# +# Default: force +sp_after_semi_for = force # ignore/add/remove/force + +# Add or remove space after the final semicolon of an empty part of a for +# statement, as in 'for ( ; ; )'. +sp_after_semi_for_empty = ignore # ignore/add/remove/force + +# Add or remove space before '[' (except '[]'). +sp_before_square = ignore # ignore/add/remove/force + +# Add or remove space before '[' for a variable definition. +# +# Default: remove +sp_before_vardef_square = remove # ignore/add/remove/force + +# Add or remove space before '[' for asm block. +sp_before_square_asm_block = ignore # ignore/add/remove/force + +# Add or remove space before '[]'. +sp_before_squares = ignore # ignore/add/remove/force + +# Add or remove space before C++17 structured bindings. +sp_cpp_before_struct_binding = ignore # ignore/add/remove/force + +# Add or remove space inside a non-empty '[' and ']'. +sp_inside_square = ignore # ignore/add/remove/force + +# Add or remove space inside '[]'. +sp_inside_square_empty = ignore # ignore/add/remove/force + +# (OC) Add or remove space inside a non-empty Objective-C boxed array '@[' and +# ']'. If set to ignore, sp_inside_square is used. +sp_inside_square_oc_array = ignore # ignore/add/remove/force + +# Add or remove space after ',', i.e. 'a,b' vs. 'a, b'. +sp_after_comma = ignore # ignore/add/remove/force + +# Add or remove space before ','. +# +# Default: remove +sp_before_comma = remove # ignore/add/remove/force + +# (C#) Add or remove space between ',' and ']' in multidimensional array type +# like 'int[,,]'. +sp_after_mdatype_commas = ignore # ignore/add/remove/force + +# (C#) Add or remove space between '[' and ',' in multidimensional array type +# like 'int[,,]'. +sp_before_mdatype_commas = ignore # ignore/add/remove/force + +# (C#) Add or remove space between ',' in multidimensional array type +# like 'int[,,]'. +sp_between_mdatype_commas = ignore # ignore/add/remove/force + +# Add or remove space between an open parenthesis and comma, +# i.e. '(,' vs. '( ,'. +# +# Default: force +sp_paren_comma = force # ignore/add/remove/force + +# Add or remove space before the variadic '...' when preceded by a +# non-punctuator. +sp_before_ellipsis = ignore # ignore/add/remove/force + +# Add or remove space between a type and '...'. +sp_type_ellipsis = ignore # ignore/add/remove/force + +# (D) Add or remove space between a type and '?'. +sp_type_question = ignore # ignore/add/remove/force + +# Add or remove space between ')' and '...'. +sp_paren_ellipsis = ignore # ignore/add/remove/force + +# Add or remove space between ')' and a qualifier such as 'const'. +sp_paren_qualifier = ignore # ignore/add/remove/force + +# Add or remove space between ')' and 'noexcept'. +sp_paren_noexcept = ignore # ignore/add/remove/force + +# Add or remove space after class ':'. +sp_after_class_colon = ignore # ignore/add/remove/force + +# Add or remove space before class ':'. +sp_before_class_colon = ignore # ignore/add/remove/force + +# Add or remove space after class constructor ':'. +sp_after_constr_colon = ignore # ignore/add/remove/force + +# Add or remove space before class constructor ':'. +sp_before_constr_colon = ignore # ignore/add/remove/force + +# Add or remove space before case ':'. +# +# Default: remove +sp_before_case_colon = remove # ignore/add/remove/force + +# Add or remove space between 'operator' and operator sign. +sp_after_operator = ignore # ignore/add/remove/force + +# Add or remove space between the operator symbol and the open parenthesis, as +# in 'operator ++('. +sp_after_operator_sym = ignore # ignore/add/remove/force + +# Overrides sp_after_operator_sym when the operator has no arguments, as in +# 'operator *()'. +sp_after_operator_sym_empty = ignore # ignore/add/remove/force + +# Add or remove space after C/D cast, i.e. 'cast(int)a' vs. 'cast(int) a' or +# '(int)a' vs. '(int) a'. +sp_after_cast = ignore # ignore/add/remove/force + +# Add or remove spaces inside cast parentheses. +sp_inside_paren_cast = ignore # ignore/add/remove/force + +# Add or remove space between the type and open parenthesis in a C++ cast, +# i.e. 'int(exp)' vs. 'int (exp)'. +sp_cpp_cast_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'sizeof' and '('. +sp_sizeof_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'sizeof' and '...'. +sp_sizeof_ellipsis = ignore # ignore/add/remove/force + +# Add or remove space between 'sizeof...' and '('. +sp_sizeof_ellipsis_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'decltype' and '('. +sp_decltype_paren = ignore # ignore/add/remove/force + +# (Pawn) Add or remove space after the tag keyword. +sp_after_tag = ignore # ignore/add/remove/force + +# Add or remove space inside enum '{' and '}'. +sp_inside_braces_enum = ignore # ignore/add/remove/force + +# Add or remove space inside struct/union '{' and '}'. +sp_inside_braces_struct = ignore # ignore/add/remove/force + +# (OC) Add or remove space inside Objective-C boxed dictionary '{' and '}' +sp_inside_braces_oc_dict = ignore # ignore/add/remove/force + +# Add or remove space after open brace in an unnamed temporary +# direct-list-initialization. +sp_after_type_brace_init_lst_open = ignore # ignore/add/remove/force + +# Add or remove space before close brace in an unnamed temporary +# direct-list-initialization. +sp_before_type_brace_init_lst_close = ignore # ignore/add/remove/force + +# Add or remove space inside an unnamed temporary direct-list-initialization. +sp_inside_type_brace_init_lst = ignore # ignore/add/remove/force + +# Add or remove space inside '{' and '}'. +sp_inside_braces = ignore # ignore/add/remove/force + +# Add or remove space inside '{}'. +sp_inside_braces_empty = ignore # ignore/add/remove/force + +# Add or remove space around trailing return operator '->'. +sp_trailing_return = ignore # ignore/add/remove/force + +# Add or remove space between return type and function name. A minimum of 1 +# is forced except for pointer return types. +sp_type_func = ignore # ignore/add/remove/force + +# Add or remove space between type and open brace of an unnamed temporary +# direct-list-initialization. +sp_type_brace_init_lst = ignore # ignore/add/remove/force + +# Add or remove space between function name and '(' on function declaration. +sp_func_proto_paren = ignore # ignore/add/remove/force + +# Add or remove space between function name and '()' on function declaration +# without parameters. +sp_func_proto_paren_empty = ignore # ignore/add/remove/force + +# Add or remove space between function name and '(' with a typedef specifier. +sp_func_type_paren = ignore # ignore/add/remove/force + +# Add or remove space between alias name and '(' of a non-pointer function type typedef. +sp_func_def_paren = ignore # ignore/add/remove/force + +# Add or remove space between function name and '()' on function definition +# without parameters. +sp_func_def_paren_empty = ignore # ignore/add/remove/force + +# Add or remove space inside empty function '()'. +# Overrides sp_after_angle unless use_sp_after_angle_always is set to true. +sp_inside_fparens = ignore # ignore/add/remove/force + +# Add or remove space inside function '(' and ')'. +sp_inside_fparen = ignore # ignore/add/remove/force + +# Add or remove space inside the first parentheses in a function type, as in +# 'void (*x)(...)'. +sp_inside_tparen = ignore # ignore/add/remove/force + +# Add or remove space between the ')' and '(' in a function type, as in +# 'void (*x)(...)'. +sp_after_tparen_close = ignore # ignore/add/remove/force + +# Add or remove space between ']' and '(' when part of a function call. +sp_square_fparen = ignore # ignore/add/remove/force + +# Add or remove space between ')' and '{' of function. +sp_fparen_brace = ignore # ignore/add/remove/force + +# Add or remove space between ')' and '{' of a function call in object +# initialization. +# +# Overrides sp_fparen_brace. +sp_fparen_brace_initializer = ignore # ignore/add/remove/force + +# (Java) Add or remove space between ')' and '{{' of double brace initializer. +sp_fparen_dbrace = ignore # ignore/add/remove/force + +# Add or remove space between function name and '(' on function calls. +sp_func_call_paren = ignore # ignore/add/remove/force + +# Add or remove space between function name and '()' on function calls without +# parameters. If set to ignore (the default), sp_func_call_paren is used. +sp_func_call_paren_empty = ignore # ignore/add/remove/force + +# Add or remove space between the user function name and '(' on function +# calls. You need to set a keyword to be a user function in the config file, +# like: +# set func_call_user tr _ i18n +sp_func_call_user_paren = ignore # ignore/add/remove/force + +# Add or remove space inside user function '(' and ')'. +sp_func_call_user_inside_fparen = ignore # ignore/add/remove/force + +# Add or remove space between nested parentheses with user functions, +# i.e. '((' vs. '( ('. +sp_func_call_user_paren_paren = ignore # ignore/add/remove/force + +# Add or remove space between a constructor/destructor and the open +# parenthesis. +sp_func_class_paren = ignore # ignore/add/remove/force + +# Add or remove space between a constructor without parameters or destructor +# and '()'. +sp_func_class_paren_empty = ignore # ignore/add/remove/force + +# Add or remove space between 'return' and '('. +sp_return_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'return' and '{'. +sp_return_brace = ignore # ignore/add/remove/force + +# Add or remove space between '__attribute__' and '('. +sp_attribute_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'defined' and '(' in '#if defined (FOO)'. +sp_defined_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'throw' and '(' in 'throw (something)'. +sp_throw_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'throw' and anything other than '(' as in +# '@throw [...];'. +sp_after_throw = ignore # ignore/add/remove/force + +# Add or remove space between 'catch' and '(' in 'catch (something) { }'. +# If set to ignore, sp_before_sparen is used. +sp_catch_paren = ignore # ignore/add/remove/force + +# (OC) Add or remove space between '@catch' and '(' +# in '@catch (something) { }'. If set to ignore, sp_catch_paren is used. +sp_oc_catch_paren = ignore # ignore/add/remove/force + +# (OC) Add or remove space before Objective-C protocol list +# as in '@protocol Protocol' or '@interface MyClass : NSObject'. +sp_before_oc_proto_list = ignore # ignore/add/remove/force + +# (OC) Add or remove space between class name and '(' +# in '@interface className(categoryName):BaseClass' +sp_oc_classname_paren = ignore # ignore/add/remove/force + +# (D) Add or remove space between 'version' and '(' +# in 'version (something) { }'. If set to ignore, sp_before_sparen is used. +sp_version_paren = ignore # ignore/add/remove/force + +# (D) Add or remove space between 'scope' and '(' +# in 'scope (something) { }'. If set to ignore, sp_before_sparen is used. +sp_scope_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'super' and '(' in 'super (something)'. +# +# Default: remove +sp_super_paren = remove # ignore/add/remove/force + +# Add or remove space between 'this' and '(' in 'this (something)'. +# +# Default: remove +sp_this_paren = remove # ignore/add/remove/force + +# Add or remove space between a macro name and its definition. +sp_macro = ignore # ignore/add/remove/force + +# Add or remove space between a macro function ')' and its definition. +sp_macro_func = ignore # ignore/add/remove/force + +# Add or remove space between 'else' and '{' if on the same line. +sp_else_brace = ignore # ignore/add/remove/force + +# Add or remove space between '}' and 'else' if on the same line. +sp_brace_else = ignore # ignore/add/remove/force + +# Add or remove space between '}' and the name of a typedef on the same line. +sp_brace_typedef = ignore # ignore/add/remove/force + +# Add or remove space before the '{' of a 'catch' statement, if the '{' and +# 'catch' are on the same line, as in 'catch (decl) {'. +sp_catch_brace = ignore # ignore/add/remove/force + +# (OC) Add or remove space before the '{' of a '@catch' statement, if the '{' +# and '@catch' are on the same line, as in '@catch (decl) {'. +# If set to ignore, sp_catch_brace is used. +sp_oc_catch_brace = ignore # ignore/add/remove/force + +# Add or remove space between '}' and 'catch' if on the same line. +sp_brace_catch = ignore # ignore/add/remove/force + +# (OC) Add or remove space between '}' and '@catch' if on the same line. +# If set to ignore, sp_brace_catch is used. +sp_oc_brace_catch = ignore # ignore/add/remove/force + +# Add or remove space between 'finally' and '{' if on the same line. +sp_finally_brace = ignore # ignore/add/remove/force + +# Add or remove space between '}' and 'finally' if on the same line. +sp_brace_finally = ignore # ignore/add/remove/force + +# Add or remove space between 'try' and '{' if on the same line. +sp_try_brace = ignore # ignore/add/remove/force + +# Add or remove space between get/set and '{' if on the same line. +sp_getset_brace = ignore # ignore/add/remove/force + +# Add or remove space between a variable and '{' for C++ uniform +# initialization. +sp_word_brace_init_lst = ignore # ignore/add/remove/force + +# Add or remove space between a variable and '{' for a namespace. +# +# Default: add +sp_word_brace_ns = add # ignore/add/remove/force + +# Add or remove space before the '::' operator. +sp_before_dc = ignore # ignore/add/remove/force + +# Add or remove space after the '::' operator. +sp_after_dc = ignore # ignore/add/remove/force + +# (D) Add or remove around the D named array initializer ':' operator. +sp_d_array_colon = ignore # ignore/add/remove/force + +# Add or remove space after the '!' (not) unary operator. +# +# Default: remove +sp_not = remove # ignore/add/remove/force + +# Add or remove space after the '~' (invert) unary operator. +# +# Default: remove +sp_inv = remove # ignore/add/remove/force + +# Add or remove space after the '&' (address-of) unary operator. This does not +# affect the spacing after a '&' that is part of a type. +# +# Default: remove +sp_addr = remove # ignore/add/remove/force + +# Add or remove space around the '.' or '->' operators. +# +# Default: remove +sp_member = remove # ignore/add/remove/force + +# Add or remove space after the '*' (dereference) unary operator. This does +# not affect the spacing after a '*' that is part of a type. +# +# Default: remove +sp_deref = remove # ignore/add/remove/force + +# Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. +# +# Default: remove +sp_sign = remove # ignore/add/remove/force + +# Add or remove space between '++' and '--' the word to which it is being +# applied, as in '(--x)' or 'y++;'. +# +# Default: remove +sp_incdec = remove # ignore/add/remove/force + +# Add or remove space before a backslash-newline at the end of a line. +# +# Default: add +sp_before_nl_cont = add # ignore/add/remove/force + +# (OC) Add or remove space after the scope '+' or '-', as in '-(void) foo;' +# or '+(int) bar;'. +sp_after_oc_scope = ignore # ignore/add/remove/force + +# (OC) Add or remove space after the colon in message specs, +# i.e. '-(int) f:(int) x;' vs. '-(int) f: (int) x;'. +sp_after_oc_colon = ignore # ignore/add/remove/force + +# (OC) Add or remove space before the colon in message specs, +# i.e. '-(int) f: (int) x;' vs. '-(int) f : (int) x;'. +sp_before_oc_colon = ignore # ignore/add/remove/force + +# (OC) Add or remove space after the colon in immutable dictionary expression +# 'NSDictionary *test = @{@"foo" :@"bar"};'. +sp_after_oc_dict_colon = ignore # ignore/add/remove/force + +# (OC) Add or remove space before the colon in immutable dictionary expression +# 'NSDictionary *test = @{@"foo" :@"bar"};'. +sp_before_oc_dict_colon = ignore # ignore/add/remove/force + +# (OC) Add or remove space after the colon in message specs, +# i.e. '[object setValue:1];' vs. '[object setValue: 1];'. +sp_after_send_oc_colon = ignore # ignore/add/remove/force + +# (OC) Add or remove space before the colon in message specs, +# i.e. '[object setValue:1];' vs. '[object setValue :1];'. +sp_before_send_oc_colon = ignore # ignore/add/remove/force + +# (OC) Add or remove space after the (type) in message specs, +# i.e. '-(int)f: (int) x;' vs. '-(int)f: (int)x;'. +sp_after_oc_type = ignore # ignore/add/remove/force + +# (OC) Add or remove space after the first (type) in message specs, +# i.e. '-(int) f:(int)x;' vs. '-(int)f:(int)x;'. +sp_after_oc_return_type = ignore # ignore/add/remove/force + +# (OC) Add or remove space between '@selector' and '(', +# i.e. '@selector(msgName)' vs. '@selector (msgName)'. +# Also applies to '@protocol()' constructs. +sp_after_oc_at_sel = ignore # ignore/add/remove/force + +# (OC) Add or remove space between '@selector(x)' and the following word, +# i.e. '@selector(foo) a:' vs. '@selector(foo)a:'. +sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force + +# (OC) Add or remove space inside '@selector' parentheses, +# i.e. '@selector(foo)' vs. '@selector( foo )'. +# Also applies to '@protocol()' constructs. +sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force + +# (OC) Add or remove space before a block pointer caret, +# i.e. '^int (int arg){...}' vs. ' ^int (int arg){...}'. +sp_before_oc_block_caret = ignore # ignore/add/remove/force + +# (OC) Add or remove space after a block pointer caret, +# i.e. '^int (int arg){...}' vs. '^ int (int arg){...}'. +sp_after_oc_block_caret = ignore # ignore/add/remove/force + +# (OC) Add or remove space between the receiver and selector in a message, +# as in '[receiver selector ...]'. +sp_after_oc_msg_receiver = ignore # ignore/add/remove/force + +# (OC) Add or remove space after '@property'. +sp_after_oc_property = ignore # ignore/add/remove/force + +# (OC) Add or remove space between '@synchronized' and the open parenthesis, +# i.e. '@synchronized(foo)' vs. '@synchronized (foo)'. +sp_after_oc_synchronized = ignore # ignore/add/remove/force + +# Add or remove space around the ':' in 'b ? t : f'. +sp_cond_colon = ignore # ignore/add/remove/force + +# Add or remove space before the ':' in 'b ? t : f'. +# +# Overrides sp_cond_colon. +sp_cond_colon_before = ignore # ignore/add/remove/force + +# Add or remove space after the ':' in 'b ? t : f'. +# +# Overrides sp_cond_colon. +sp_cond_colon_after = ignore # ignore/add/remove/force + +# Add or remove space around the '?' in 'b ? t : f'. +sp_cond_question = ignore # ignore/add/remove/force + +# Add or remove space before the '?' in 'b ? t : f'. +# +# Overrides sp_cond_question. +sp_cond_question_before = ignore # ignore/add/remove/force + +# Add or remove space after the '?' in 'b ? t : f'. +# +# Overrides sp_cond_question. +sp_cond_question_after = ignore # ignore/add/remove/force + +# In the abbreviated ternary form '(a ?: b)', add or remove space between '?' +# and ':'. +# +# Overrides all other sp_cond_* options. +sp_cond_ternary_short = ignore # ignore/add/remove/force + +# Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make +# sense here. +sp_case_label = ignore # ignore/add/remove/force + +# (D) Add or remove space around the D '..' operator. +sp_range = ignore # ignore/add/remove/force + +# Add or remove space after ':' in a Java/C++11 range-based 'for', +# as in 'for (Type var : expr)'. +sp_after_for_colon = ignore # ignore/add/remove/force + +# Add or remove space before ':' in a Java/C++11 range-based 'for', +# as in 'for (Type var : expr)'. +sp_before_for_colon = ignore # ignore/add/remove/force + +# (D) Add or remove space between 'extern' and '(' as in 'extern (C)'. +sp_extern_paren = ignore # ignore/add/remove/force + +# Add or remove space after the opening of a C++ comment, +# i.e. '// A' vs. '//A'. +sp_cmt_cpp_start = ignore # ignore/add/remove/force + +# If true, space is added with sp_cmt_cpp_start will be added after doxygen +# sequences like '///', '///<', '//!' and '//!<'. +sp_cmt_cpp_doxygen = false # true/false + +# If true, space is added with sp_cmt_cpp_start will be added after Qt +# translator or meta-data comments like '//:', '//=', and '//~'. +sp_cmt_cpp_qttr = false # true/false + +# Add or remove space between #else or #endif and a trailing comment. +sp_endif_cmt = ignore # ignore/add/remove/force + +# Add or remove space after 'new', 'delete' and 'delete[]'. +sp_after_new = ignore # ignore/add/remove/force + +# Add or remove space between 'new' and '(' in 'new()'. +sp_between_new_paren = ignore # ignore/add/remove/force + +# Add or remove space between ')' and type in 'new(foo) BAR'. +sp_after_newop_paren = ignore # ignore/add/remove/force + +# Add or remove space inside parenthesis of the new operator +# as in 'new(foo) BAR'. +sp_inside_newop_paren = ignore # ignore/add/remove/force + +# Add or remove space after the open parenthesis of the new operator, +# as in 'new(foo) BAR'. +# +# Overrides sp_inside_newop_paren. +sp_inside_newop_paren_open = ignore # ignore/add/remove/force + +# Add or remove space before the close parenthesis of the new operator, +# as in 'new(foo) BAR'. +# +# Overrides sp_inside_newop_paren. +sp_inside_newop_paren_close = ignore # ignore/add/remove/force + +# Add or remove space before a trailing or embedded comment. +sp_before_tr_emb_cmt = ignore # ignore/add/remove/force + +# Number of spaces before a trailing or embedded comment. +sp_num_before_tr_emb_cmt = 0 # unsigned number + +# (Java) Add or remove space between an annotation and the open parenthesis. +sp_annotation_paren = ignore # ignore/add/remove/force + +# If true, vbrace tokens are dropped to the previous token and skipped. +sp_skip_vbrace_tokens = false # true/false + +# Add or remove space after 'noexcept'. +sp_after_noexcept = ignore # ignore/add/remove/force + +# Add or remove space after '_'. +sp_vala_after_translation = ignore # ignore/add/remove/force + +# If true, a is inserted after #define. +force_tab_after_define = false # true/false + +# +# Indenting options +# + +# The number of columns to indent per level. Usually 2, 3, 4, or 8. +# +# Default: 8 +indent_columns = 8 # unsigned number + +# The continuation indent. If non-zero, this overrides the indent of '(', '[' +# and '=' continuation indents. Negative values are OK; negative value is +# absolute and not increased for each '(' or '[' level. +# +# For FreeBSD, this is set to 4. +indent_continue = 0 # number + +# The continuation indent, only for class header line(s). If non-zero, this +# overrides the indent of 'class' continuation indents. +indent_continue_class_head = 0 # unsigned number + +# Whether to indent empty lines (i.e. lines which contain only spaces before +# the newline character). +indent_single_newlines = false # true/false + +# The continuation indent for func_*_param if they are true. If non-zero, this +# overrides the indent. +indent_param = 0 # unsigned number + +# How to use tabs when indenting code. +# +# 0: Spaces only +# 1: Indent with tabs to brace level, align with spaces (default) +# 2: Indent and align with tabs, using spaces when not on a tabstop +# +# Default: 1 +indent_with_tabs = 1 # unsigned number + +# Whether to indent comments that are not at a brace level with tabs on a +# tabstop. Requires indent_with_tabs=2. If false, will use spaces. +indent_cmt_with_tabs = false # true/false + +# Whether to indent strings broken by '\' so that they line up. +indent_align_string = false # true/false + +# The number of spaces to indent multi-line XML strings. +# Requires indent_align_string=true. +indent_xml_string = 0 # unsigned number + +# Spaces to indent '{' from level. +indent_brace = 0 # unsigned number + +# Whether braces are indented to the body level. +indent_braces = false # true/false + +# Whether to disable indenting function braces if indent_braces=true. +indent_braces_no_func = false # true/false + +# Whether to disable indenting class braces if indent_braces=true. +indent_braces_no_class = false # true/false + +# Whether to disable indenting struct braces if indent_braces=true. +indent_braces_no_struct = false # true/false + +# Whether to indent based on the size of the brace parent, +# i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. +indent_brace_parent = false # true/false + +# Whether to indent based on the open parenthesis instead of the open brace +# in '({\n'. +indent_paren_open_brace = false # true/false + +# (C#) Whether to indent the brace of a C# delegate by another level. +indent_cs_delegate_brace = false # true/false + +# (C#) Whether to indent a C# delegate (to handle delegates with no brace) by +# another level. +indent_cs_delegate_body = false # true/false + +# Whether to indent the body of a 'namespace'. +indent_namespace = false # true/false + +# Whether to indent only the first namespace, and not any nested namespaces. +# Requires indent_namespace=true. +indent_namespace_single_indent = false # true/false + +# The number of spaces to indent a namespace block. +# If set to zero, use the value indent_columns +indent_namespace_level = 0 # unsigned number + +# If the body of the namespace is longer than this number, it won't be +# indented. Requires indent_namespace=true. 0 means no limit. +indent_namespace_limit = 0 # unsigned number + +# Whether the 'extern "C"' body is indented. +indent_extern = false # true/false + +# Whether the 'class' body is indented. +indent_class = false # true/false + +# Whether to indent the stuff after a leading base class colon. +indent_class_colon = false # true/false + +# Whether to indent based on a class colon instead of the stuff after the +# colon. Requires indent_class_colon=true. +indent_class_on_colon = false # true/false + +# Whether to indent the stuff after a leading class initializer colon. +indent_constr_colon = false # true/false + +# Virtual indent from the ':' for member initializers. +# +# Default: 2 +indent_ctor_init_leading = 2 # unsigned number + +# Additional indent for constructor initializer list. +# Negative values decrease indent down to the first column. +indent_ctor_init = 0 # number + +# Whether to indent 'if' following 'else' as a new block under the 'else'. +# If false, 'else\nif' is treated as 'else if' for indenting purposes. +indent_else_if = false # true/false + +# Amount to indent variable declarations after a open brace. +# +# <0: Relative +# >=0: Absolute +indent_var_def_blk = 0 # number + +# Whether to indent continued variable declarations instead of aligning. +indent_var_def_cont = false # true/false + +# Whether to indent continued shift expressions ('<<' and '>>') instead of +# aligning. Set align_left_shift=false when enabling this. +indent_shift = false # true/false + +# Whether to force indentation of function definitions to start in column 1. +indent_func_def_force_col1 = false # true/false + +# Whether to indent continued function call parameters one indent level, +# rather than aligning parameters under the open parenthesis. +indent_func_call_param = false # true/false + +# Whether to indent continued function definition parameters one indent level, +# rather than aligning parameters under the open parenthesis. +indent_func_def_param = false # true/false + +# for function definitions, only if indent_func_def_param is false +# Allows to align params when appropriate and indent them when not +# behave as if it was true if paren position is more than this value +# if paren position is more than the option value +indent_func_def_param_paren_pos_threshold = 0 # unsigned number + +# Whether to indent continued function call prototype one indent level, +# rather than aligning parameters under the open parenthesis. +indent_func_proto_param = false # true/false + +# Whether to indent continued function call declaration one indent level, +# rather than aligning parameters under the open parenthesis. +indent_func_class_param = false # true/false + +# Whether to indent continued class variable constructors one indent level, +# rather than aligning parameters under the open parenthesis. +indent_func_ctor_var_param = false # true/false + +# Whether to indent continued template parameter list one indent level, +# rather than aligning parameters under the open parenthesis. +indent_template_param = false # true/false + +# Double the indent for indent_func_xxx_param options. +# Use both values of the options indent_columns and indent_param. +indent_func_param_double = false # true/false + +# Indentation column for standalone 'const' qualifier on a function +# prototype. +indent_func_const = 0 # unsigned number + +# Indentation column for standalone 'throw' qualifier on a function +# prototype. +indent_func_throw = 0 # unsigned number + +# How to indent within a macro followed by a brace on the same line +# This allows reducing the indent in macros that have (for example) +# `do { ... } while (0)` blocks bracketing them. +# +# true: add an indent for the brace on the same line as the macro +# false: do not add an indent for the brace on the same line as the macro +# +# Default: true +indent_macro_brace = true # true/false + +# The number of spaces to indent a continued '->' or '.'. +# Usually set to 0, 1, or indent_columns. +indent_member = 0 # unsigned number + +# Whether lines broken at '.' or '->' should be indented by a single indent. +# The indent_member option will not be effective if this is set to true. +indent_member_single = false # true/false + +# Spaces to indent single line ('//') comments on lines before code. +indent_sing_line_comments = 0 # unsigned number + +# When opening a paren for a control statement (if, for, while, etc), increase +# the indent level by this value. Negative values decrease the indent level. +indent_sparen_extra = 0 # number + +# Whether to indent trailing single line ('//') comments relative to the code +# instead of trying to keep the same absolute column. +indent_relative_single_line_comments = false # true/false + +# Spaces to indent 'case' from 'switch'. Usually 0 or indent_columns. +indent_switch_case = 0 # unsigned number + +# indent 'break' with 'case' from 'switch'. +indent_switch_break_with_case = false # true/false + +# Whether to indent preprocessor statements inside of switch statements. +# +# Default: true +indent_switch_pp = true # true/false + +# Spaces to shift the 'case' line, without affecting any other lines. +# Usually 0. +indent_case_shift = 0 # unsigned number + +# Spaces to indent '{' from 'case'. By default, the brace will appear under +# the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK. +indent_case_brace = 0 # number + +# Whether to indent comments found in first column. +indent_col1_comment = false # true/false + +# Whether to indent multi string literal in first column. +indent_col1_multi_string_literal = false # true/false + +# How to indent goto labels. +# +# >0: Absolute column where 1 is the leftmost column +# <=0: Subtract from brace indent +# +# Default: 1 +indent_label = 1 # number + +# How to indent access specifiers that are followed by a +# colon. +# +# >0: Absolute column where 1 is the leftmost column +# <=0: Subtract from brace indent +# +# Default: 1 +indent_access_spec = 1 # number + +# Whether to indent the code after an access specifier by one level. +# If true, this option forces 'indent_access_spec=0'. +indent_access_spec_body = false # true/false + +# If an open parenthesis is followed by a newline, whether to indent the next +# line so that it lines up after the open parenthesis (not recommended). +indent_paren_nl = false # true/false + +# How to indent a close parenthesis after a newline. +# +# 0: Indent to body level (default) +# 1: Align under the open parenthesis +# 2: Indent to the brace level +indent_paren_close = 0 # unsigned number + +# Whether to indent the open parenthesis of a function definition, +# if the parenthesis is on its own line. +indent_paren_after_func_def = false # true/false + +# Whether to indent the open parenthesis of a function declaration, +# if the parenthesis is on its own line. +indent_paren_after_func_decl = false # true/false + +# Whether to indent the open parenthesis of a function call, +# if the parenthesis is on its own line. +indent_paren_after_func_call = false # true/false + +# Whether to indent a comma when inside a parenthesis. +# If true, aligns under the open parenthesis. +indent_comma_paren = false # true/false + +# Whether to indent a Boolean operator when inside a parenthesis. +# If true, aligns under the open parenthesis. +indent_bool_paren = false # true/false + +# Whether to indent a semicolon when inside a for parenthesis. +# If true, aligns under the open for parenthesis. +indent_semicolon_for_paren = false # true/false + +# Whether to align the first expression to following ones +# if indent_bool_paren=true. +indent_first_bool_expr = false # true/false + +# Whether to align the first expression to following ones +# if indent_semicolon_for_paren=true. +indent_first_for_expr = false # true/false + +# If an open square is followed by a newline, whether to indent the next line +# so that it lines up after the open square (not recommended). +indent_square_nl = false # true/false + +# (ESQL/C) Whether to preserve the relative indent of 'EXEC SQL' bodies. +indent_preserve_sql = false # true/false + +# Whether to align continued statements at the '='. If false or if the '=' is +# followed by a newline, the next line is indent one tab. +# +# Default: true +indent_align_assign = true # true/false + +# If true, the indentation of the chunks after a '=' sequence will be set at +# LHS token indentation column before '='. +indent_off_after_assign = false # true/false + +# Whether to align continued statements at the '('. If false or the '(' is +# followed by a newline, the next line indent is one tab. +# +# Default: true +indent_align_paren = true # true/false + +# (OC) Whether to indent Objective-C code inside message selectors. +indent_oc_inside_msg_sel = false # true/false + +# (OC) Whether to indent Objective-C blocks at brace level instead of usual +# rules. +indent_oc_block = false # true/false + +# (OC) Indent for Objective-C blocks in a message relative to the parameter +# name. +# +# =0: Use indent_oc_block rules +# >0: Use specified number of spaces to indent +indent_oc_block_msg = 0 # unsigned number + +# (OC) Minimum indent for subsequent parameters +indent_oc_msg_colon = 0 # unsigned number + +# (OC) Whether to prioritize aligning with initial colon (and stripping spaces +# from lines, if necessary). +# +# Default: true +indent_oc_msg_prioritize_first_colon = true # true/false + +# (OC) Whether to indent blocks the way that Xcode does by default +# (from the keyword if the parameter is on its own line; otherwise, from the +# previous indentation level). Requires indent_oc_block_msg=true. +indent_oc_block_msg_xcode_style = false # true/false + +# (OC) Whether to indent blocks from where the brace is, relative to a +# message keyword. Requires indent_oc_block_msg=true. +indent_oc_block_msg_from_keyword = false # true/false + +# (OC) Whether to indent blocks from where the brace is, relative to a message +# colon. Requires indent_oc_block_msg=true. +indent_oc_block_msg_from_colon = false # true/false + +# (OC) Whether to indent blocks from where the block caret is. +# Requires indent_oc_block_msg=true. +indent_oc_block_msg_from_caret = false # true/false + +# (OC) Whether to indent blocks from where the brace caret is. +# Requires indent_oc_block_msg=true. +indent_oc_block_msg_from_brace = false # true/false + +# When indenting after virtual brace open and newline add further spaces to +# reach this minimum indent. +indent_min_vbrace_open = 0 # unsigned number + +# Whether to add further spaces after regular indent to reach next tabstop +# when indenting after virtual brace open and newline. +indent_vbrace_open_on_tabstop = false # true/false + +# How to indent after a brace followed by another token (not a newline). +# true: indent all contained lines to match the token +# false: indent all contained lines to match the brace +# +# Default: true +indent_token_after_brace = true # true/false + +# Whether to indent the body of a C++11 lambda. +indent_cpp_lambda_body = false # true/false + +# How to indent compound literals that are being returned. +# true: add both the indent from return & the compound literal open brace (ie: +# 2 indent levels) +# false: only indent 1 level, don't add the indent for the open brace, only add +# the indent for the return. +# +# Default: true +indent_compound_literal_return = true # true/false + +# (C#) Whether to indent a 'using' block if no braces are used. +# +# Default: true +indent_using_block = true # true/false + +# How to indent the continuation of ternary operator. +# +# 0: Off (default) +# 1: When the `if_false` is a continuation, indent it under `if_false` +# 2: When the `:` is a continuation, indent it under `?` +indent_ternary_operator = 0 # unsigned number + +# Whether to indent the statments inside ternary operator. +indent_inside_ternary_operator = false # true/false + +# If true, the indentation of the chunks after a `return` sequence will be set at return indentation column. +indent_off_after_return = false # true/false + +# If true, the indentation of the chunks after a `return new` sequence will be set at return indentation column. +indent_off_after_return_new = false # true/false + +# If true, the tokens after return are indented with regular single indentation. By default (false) the indentation is after the return token. +indent_single_after_return = false # true/false + +# Whether to ignore indent and alignment for 'asm' blocks (i.e. assume they +# have their own indentation). +indent_ignore_asm_block = false # true/false + +# Don't indent the close parenthesis of a function definition, +# if the parenthesis is on its own line. +donot_indent_func_def_close_paren = false # true/false + +# +# Newline adding and removing options +# + +# Whether to collapse empty blocks between '{' and '}'. +# If true, overrides nl_inside_empty_func +nl_collapse_empty_body = false # true/false + +# Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'. +nl_assign_leave_one_liners = false # true/false + +# Don't split one-line braced statements inside a 'class xx { }' body. +nl_class_leave_one_liners = false # true/false + +# Don't split one-line enums, as in 'enum foo { BAR = 15 };' +nl_enum_leave_one_liners = false # true/false + +# Don't split one-line get or set functions. +nl_getset_leave_one_liners = false # true/false + +# (C#) Don't split one-line property get or set functions. +nl_cs_property_leave_one_liners = false # true/false + +# Don't split one-line function definitions, as in 'int foo() { return 0; }'. +# might modify nl_func_type_name +nl_func_leave_one_liners = false # true/false + +# Don't split one-line C++11 lambdas, as in '[]() { return 0; }'. +nl_cpp_lambda_leave_one_liners = false # true/false + +# Don't split one-line if/else statements, as in 'if(...) b++;'. +nl_if_leave_one_liners = false # true/false + +# Don't split one-line while statements, as in 'while(...) b++;'. +nl_while_leave_one_liners = false # true/false + +# Don't split one-line for statements, as in 'for(...) b++;'. +nl_for_leave_one_liners = false # true/false + +# (OC) Don't split one-line Objective-C messages. +nl_oc_msg_leave_one_liner = false # true/false + +# (OC) Add or remove newline between method declaration and '{'. +nl_oc_mdef_brace = ignore # ignore/add/remove/force + +# (OC) Add or remove newline between Objective-C block signature and '{'. +nl_oc_block_brace = ignore # ignore/add/remove/force + +# (OC) Add or remove blank line before '@interface' statement. +nl_oc_before_interface = ignore # ignore/add/remove/force + +# (OC) Add or remove blank line before '@implementation' statement. +nl_oc_before_implementation = ignore # ignore/add/remove/force + +# (OC) Add or remove blank line before '@end' statement. +nl_oc_before_end = ignore # ignore/add/remove/force + +# (OC) Add or remove newline between '@interface' and '{'. +nl_oc_interface_brace = ignore # ignore/add/remove/force + +# (OC) Add or remove newline between '@implementation' and '{'. +nl_oc_implementation_brace = ignore # ignore/add/remove/force + +# Add or remove newlines at the start of the file. +nl_start_of_file = ignore # ignore/add/remove/force + +# The minimum number of newlines at the start of the file (only used if +# nl_start_of_file is 'add' or 'force'). +nl_start_of_file_min = 0 # unsigned number + +# Add or remove newline at the end of the file. +nl_end_of_file = ignore # ignore/add/remove/force + +# The minimum number of newlines at the end of the file (only used if +# nl_end_of_file is 'add' or 'force'). +nl_end_of_file_min = 0 # unsigned number + +# Add or remove newline between '=' and '{'. +nl_assign_brace = ignore # ignore/add/remove/force + +# (D) Add or remove newline between '=' and '['. +nl_assign_square = ignore # ignore/add/remove/force + +# Add or remove newline between '[]' and '{'. +nl_tsquare_brace = ignore # ignore/add/remove/force + +# (D) Add or remove newline after '= ['. Will also affect the newline before +# the ']'. +nl_after_square_assign = ignore # ignore/add/remove/force + +# Add or remove newline between a function call's ')' and '{', as in +# 'list_for_each(item, &list) { }'. +nl_fcall_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'enum' and '{'. +nl_enum_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'enum' and 'class'. +nl_enum_class = ignore # ignore/add/remove/force + +# Add or remove newline between 'enum class' and the identifier. +nl_enum_class_identifier = ignore # ignore/add/remove/force + +# Add or remove newline between 'enum class' type and ':'. +nl_enum_identifier_colon = ignore # ignore/add/remove/force + +# Add or remove newline between 'enum class identifier :' and type. +nl_enum_colon_type = ignore # ignore/add/remove/force + +# Add or remove newline between 'struct and '{'. +nl_struct_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'union' and '{'. +nl_union_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'if' and '{'. +nl_if_brace = ignore # ignore/add/remove/force + +# Add or remove newline between '}' and 'else'. +nl_brace_else = ignore # ignore/add/remove/force + +# Add or remove newline between 'else if' and '{'. If set to ignore, +# nl_if_brace is used instead. +nl_elseif_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'else' and '{'. +nl_else_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'else' and 'if'. +nl_else_if = ignore # ignore/add/remove/force + +# Add or remove newline before '{' opening brace +nl_before_opening_brace_func_class_def = ignore # ignore/add/remove/force + +# Add or remove newline before 'if'/'else if' closing parenthesis. +nl_before_if_closing_paren = ignore # ignore/add/remove/force + +# Add or remove newline between '}' and 'finally'. +nl_brace_finally = ignore # ignore/add/remove/force + +# Add or remove newline between 'finally' and '{'. +nl_finally_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'try' and '{'. +nl_try_brace = ignore # ignore/add/remove/force + +# Add or remove newline between get/set and '{'. +nl_getset_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'for' and '{'. +nl_for_brace = ignore # ignore/add/remove/force + +# Add or remove newline before the '{' of a 'catch' statement, as in +# 'catch (decl) {'. +nl_catch_brace = ignore # ignore/add/remove/force + +# (OC) Add or remove newline before the '{' of a '@catch' statement, as in +# '@catch (decl) {'. If set to ignore, nl_catch_brace is used. +nl_oc_catch_brace = ignore # ignore/add/remove/force + +# Add or remove newline between '}' and 'catch'. +nl_brace_catch = ignore # ignore/add/remove/force + +# (OC) Add or remove newline between '}' and '@catch'. If set to ignore, +# nl_brace_catch is used. +nl_oc_brace_catch = ignore # ignore/add/remove/force + +# Add or remove newline between '}' and ']'. +nl_brace_square = ignore # ignore/add/remove/force + +# Add or remove newline between '}' and ')' in a function invocation. +nl_brace_fparen = ignore # ignore/add/remove/force + +# Add or remove newline between 'while' and '{'. +nl_while_brace = ignore # ignore/add/remove/force + +# (D) Add or remove newline between 'scope (x)' and '{'. +nl_scope_brace = ignore # ignore/add/remove/force + +# (D) Add or remove newline between 'unittest' and '{'. +nl_unittest_brace = ignore # ignore/add/remove/force + +# (D) Add or remove newline between 'version (x)' and '{'. +nl_version_brace = ignore # ignore/add/remove/force + +# (C#) Add or remove newline between 'using' and '{'. +nl_using_brace = ignore # ignore/add/remove/force + +# Add or remove newline between two open or close braces. Due to general +# newline/brace handling, REMOVE may not work. +nl_brace_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'do' and '{'. +nl_do_brace = ignore # ignore/add/remove/force + +# Add or remove newline between '}' and 'while' of 'do' statement. +nl_brace_while = ignore # ignore/add/remove/force + +# Add or remove newline between 'switch' and '{'. +nl_switch_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'synchronized' and '{'. +nl_synchronized_brace = ignore # ignore/add/remove/force + +# Add a newline between ')' and '{' if the ')' is on a different line than the +# if/for/etc. +# +# Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch and +# nl_catch_brace. +nl_multi_line_cond = false # true/false + +# Add a newline after '(' if an if/for/while/switch condition spans multiple +# lines +nl_multi_line_sparen_open = ignore # ignore/add/remove/force + +# Add a newline before ')' if an if/for/while/switch condition spans multiple +# lines. Overrides nl_before_if_closing_paren if both are specified. +nl_multi_line_sparen_close = ignore # ignore/add/remove/force + +# Force a newline in a define after the macro name for multi-line defines. +nl_multi_line_define = false # true/false + +# Whether to add a newline before 'case', and a blank line before a 'case' +# statement that follows a ';' or '}'. +nl_before_case = false # true/false + +# Whether to add a newline after a 'case' statement. +nl_after_case = false # true/false + +# Add or remove newline between a case ':' and '{'. +# +# Overrides nl_after_case. +nl_case_colon_brace = ignore # ignore/add/remove/force + +# Add or remove newline between ')' and 'throw'. +nl_before_throw = ignore # ignore/add/remove/force + +# Add or remove newline between 'namespace' and '{'. +nl_namespace_brace = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<...>' of a template class. +nl_template_class = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<...>' of a template class declaration. +# +# Overrides nl_template_class. +nl_template_class_decl = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<>' of a specialized class declaration. +# +# Overrides nl_template_class_decl. +nl_template_class_decl_special = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<...>' of a template class definition. +# +# Overrides nl_template_class. +nl_template_class_def = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<>' of a specialized class definition. +# +# Overrides nl_template_class_def. +nl_template_class_def_special = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<...>' of a template function. +nl_template_func = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<...>' of a template function +# declaration. +# +# Overrides nl_template_func. +nl_template_func_decl = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<>' of a specialized function +# declaration. +# +# Overrides nl_template_func_decl. +nl_template_func_decl_special = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<...>' of a template function +# definition. +# +# Overrides nl_template_func. +nl_template_func_def = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<>' of a specialized function +# definition. +# +# Overrides nl_template_func_def. +nl_template_func_def_special = ignore # ignore/add/remove/force + +# Add or remove newline after 'template<...>' of a template variable. +nl_template_var = ignore # ignore/add/remove/force + +# Add or remove newline between 'template<...>' and 'using' of a templated +# type alias. +nl_template_using = ignore # ignore/add/remove/force + +# Add or remove newline between 'class' and '{'. +nl_class_brace = ignore # ignore/add/remove/force + +# Add or remove newline before or after (depending on pos_class_comma, +# may not be IGNORE) each',' in the base class list. +nl_class_init_args = ignore # ignore/add/remove/force + +# Add or remove newline after each ',' in the constructor member +# initialization. Related to nl_constr_colon, pos_constr_colon and +# pos_constr_comma. +nl_constr_init_args = ignore # ignore/add/remove/force + +# Add or remove newline before first element, after comma, and after last +# element, in 'enum'. +nl_enum_own_lines = ignore # ignore/add/remove/force + +# Add or remove newline between return type and function name in a function +# definition. +# might be modified by nl_func_leave_one_liners +nl_func_type_name = ignore # ignore/add/remove/force + +# Add or remove newline between return type and function name inside a class +# definition. If set to ignore, nl_func_type_name or nl_func_proto_type_name +# is used instead. +nl_func_type_name_class = ignore # ignore/add/remove/force + +# Add or remove newline between class specification and '::' +# in 'void A::f() { }'. Only appears in separate member implementation (does +# not appear with in-line implementation). +nl_func_class_scope = ignore # ignore/add/remove/force + +# Add or remove newline between function scope and name, as in +# 'void A :: f() { }'. +nl_func_scope_name = ignore # ignore/add/remove/force + +# Add or remove newline between return type and function name in a prototype. +nl_func_proto_type_name = ignore # ignore/add/remove/force + +# Add or remove newline between a function name and the opening '(' in the +# declaration. +nl_func_paren = ignore # ignore/add/remove/force + +# Overrides nl_func_paren for functions with no parameters. +nl_func_paren_empty = ignore # ignore/add/remove/force + +# Add or remove newline between a function name and the opening '(' in the +# definition. +nl_func_def_paren = ignore # ignore/add/remove/force + +# Overrides nl_func_def_paren for functions with no parameters. +nl_func_def_paren_empty = ignore # ignore/add/remove/force + +# Add or remove newline between a function name and the opening '(' in the +# call. +nl_func_call_paren = ignore # ignore/add/remove/force + +# Overrides nl_func_call_paren for functions with no parameters. +nl_func_call_paren_empty = ignore # ignore/add/remove/force + +# Add or remove newline after '(' in a function declaration. +nl_func_decl_start = ignore # ignore/add/remove/force + +# Add or remove newline after '(' in a function definition. +nl_func_def_start = ignore # ignore/add/remove/force + +# Overrides nl_func_decl_start when there is only one parameter. +nl_func_decl_start_single = ignore # ignore/add/remove/force + +# Overrides nl_func_def_start when there is only one parameter. +nl_func_def_start_single = ignore # ignore/add/remove/force + +# Whether to add a newline after '(' in a function declaration if '(' and ')' +# are in different lines. If false, nl_func_decl_start is used instead. +nl_func_decl_start_multi_line = false # true/false + +# Whether to add a newline after '(' in a function definition if '(' and ')' +# are in different lines. If false, nl_func_def_start is used instead. +nl_func_def_start_multi_line = false # true/false + +# Add or remove newline after each ',' in a function declaration. +nl_func_decl_args = ignore # ignore/add/remove/force + +# Add or remove newline after each ',' in a function definition. +nl_func_def_args = ignore # ignore/add/remove/force + +# Add or remove newline after each ',' in a function call. +nl_func_call_args = ignore # ignore/add/remove/force + +# Whether to add a newline after each ',' in a function declaration if '(' +# and ')' are in different lines. If false, nl_func_decl_args is used instead. +nl_func_decl_args_multi_line = false # true/false + +# Whether to add a newline after each ',' in a function definition if '(' +# and ')' are in different lines. If false, nl_func_def_args is used instead. +nl_func_def_args_multi_line = false # true/false + +# Add or remove newline before the ')' in a function declaration. +nl_func_decl_end = ignore # ignore/add/remove/force + +# Add or remove newline before the ')' in a function definition. +nl_func_def_end = ignore # ignore/add/remove/force + +# Overrides nl_func_decl_end when there is only one parameter. +nl_func_decl_end_single = ignore # ignore/add/remove/force + +# Overrides nl_func_def_end when there is only one parameter. +nl_func_def_end_single = ignore # ignore/add/remove/force + +# Whether to add a newline before ')' in a function declaration if '(' and ')' +# are in different lines. If false, nl_func_decl_end is used instead. +nl_func_decl_end_multi_line = false # true/false + +# Whether to add a newline before ')' in a function definition if '(' and ')' +# are in different lines. If false, nl_func_def_end is used instead. +nl_func_def_end_multi_line = false # true/false + +# Add or remove newline between '()' in a function declaration. +nl_func_decl_empty = ignore # ignore/add/remove/force + +# Add or remove newline between '()' in a function definition. +nl_func_def_empty = ignore # ignore/add/remove/force + +# Add or remove newline between '()' in a function call. +nl_func_call_empty = ignore # ignore/add/remove/force + +# Whether to add a newline after '(' in a function call, +# has preference over nl_func_call_start_multi_line. +nl_func_call_start = ignore # ignore/add/remove/force + +# Whether to add a newline before ')' in a function call. +nl_func_call_end = ignore # ignore/add/remove/force + +# Whether to add a newline after '(' in a function call if '(' and ')' are in +# different lines. +nl_func_call_start_multi_line = false # true/false + +# Whether to add a newline after each ',' in a function call if '(' and ')' +# are in different lines. +nl_func_call_args_multi_line = false # true/false + +# Whether to add a newline before ')' in a function call if '(' and ')' are in +# different lines. +nl_func_call_end_multi_line = false # true/false + +# Whether to respect nl_func_call_XXX option incase of closure args. +nl_func_call_args_multi_line_ignore_closures = false # true/false + +# Whether to add a newline after '<' of a template parameter list. +nl_template_start = false # true/false + +# Whether to add a newline after each ',' in a template parameter list. +nl_template_args = false # true/false + +# Whether to add a newline before '>' of a template parameter list. +nl_template_end = false # true/false + +# (OC) Whether to put each Objective-C message parameter on a separate line. +# See nl_oc_msg_leave_one_liner. +nl_oc_msg_args = false # true/false + +# Add or remove newline between function signature and '{'. +nl_fdef_brace = ignore # ignore/add/remove/force + +# Add or remove newline between function signature and '{', +# if signature ends with ')'. Overrides nl_fdef_brace. +nl_fdef_brace_cond = ignore # ignore/add/remove/force + +# Add or remove newline between C++11 lambda signature and '{'. +nl_cpp_ldef_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'return' and the return expression. +nl_return_expr = ignore # ignore/add/remove/force + +# Whether to add a newline after semicolons, except in 'for' statements. +nl_after_semicolon = false # true/false + +# (Java) Add or remove newline between the ')' and '{{' of the double brace +# initializer. +nl_paren_dbrace_open = ignore # ignore/add/remove/force + +# Whether to add a newline after the type in an unnamed temporary +# direct-list-initialization. +nl_type_brace_init_lst = ignore # ignore/add/remove/force + +# Whether to add a newline after the open brace in an unnamed temporary +# direct-list-initialization. +nl_type_brace_init_lst_open = ignore # ignore/add/remove/force + +# Whether to add a newline before the close brace in an unnamed temporary +# direct-list-initialization. +nl_type_brace_init_lst_close = ignore # ignore/add/remove/force + +# Whether to add a newline after '{'. This also adds a newline before the +# matching '}'. +nl_after_brace_open = false # true/false + +# Whether to add a newline between the open brace and a trailing single-line +# comment. Requires nl_after_brace_open=true. +nl_after_brace_open_cmt = false # true/false + +# Whether to add a newline after a virtual brace open with a non-empty body. +# These occur in un-braced if/while/do/for statement bodies. +nl_after_vbrace_open = false # true/false + +# Whether to add a newline after a virtual brace open with an empty body. +# These occur in un-braced if/while/do/for statement bodies. +nl_after_vbrace_open_empty = false # true/false + +# Whether to add a newline after '}'. Does not apply if followed by a +# necessary ';'. +nl_after_brace_close = false # true/false + +# Whether to add a newline after a virtual brace close, +# as in 'if (foo) a++; return;'. +nl_after_vbrace_close = false # true/false + +# Add or remove newline between the close brace and identifier, +# as in 'struct { int a; } b;'. Affects enumerations, unions and +# structures. If set to ignore, uses nl_after_brace_close. +nl_brace_struct_var = ignore # ignore/add/remove/force + +# Whether to alter newlines in '#define' macros. +nl_define_macro = false # true/false + +# Whether to alter newlines between consecutive parenthesis closes. The number +# of closing parentheses in a line will depend on respective open parenthesis +# lines. +nl_squeeze_paren_close = false # true/false + +# Whether to remove blanks after '#ifxx' and '#elxx', or before '#elxx' and +# '#endif'. Does not affect top-level #ifdefs. +nl_squeeze_ifdef = false # true/false + +# Makes the nl_squeeze_ifdef option affect the top-level #ifdefs as well. +nl_squeeze_ifdef_top_level = false # true/false + +# Add or remove blank line before 'if'. +nl_before_if = ignore # ignore/add/remove/force + +# Add or remove blank line after 'if' statement. Add/Force work only if the +# next token is not a closing brace. +nl_after_if = ignore # ignore/add/remove/force + +# Add or remove blank line before 'for'. +nl_before_for = ignore # ignore/add/remove/force + +# Add or remove blank line after 'for' statement. +nl_after_for = ignore # ignore/add/remove/force + +# Add or remove blank line before 'while'. +nl_before_while = ignore # ignore/add/remove/force + +# Add or remove blank line after 'while' statement. +nl_after_while = ignore # ignore/add/remove/force + +# Add or remove blank line before 'switch'. +nl_before_switch = ignore # ignore/add/remove/force + +# Add or remove blank line after 'switch' statement. +nl_after_switch = ignore # ignore/add/remove/force + +# Add or remove blank line before 'synchronized'. +nl_before_synchronized = ignore # ignore/add/remove/force + +# Add or remove blank line after 'synchronized' statement. +nl_after_synchronized = ignore # ignore/add/remove/force + +# Add or remove blank line before 'do'. +nl_before_do = ignore # ignore/add/remove/force + +# Add or remove blank line after 'do/while' statement. +nl_after_do = ignore # ignore/add/remove/force + +# Whether to put a blank line before 'return' statements, unless after an open +# brace. +nl_before_return = false # true/false + +# Whether to put a blank line after 'return' statements, unless followed by a +# close brace. +nl_after_return = false # true/false + +# Whether to put a blank line before a member '.' or '->' operators. +nl_before_member = ignore # ignore/add/remove/force + +# (Java) Whether to put a blank line after a member '.' or '->' operators. +nl_after_member = ignore # ignore/add/remove/force + +# Whether to double-space commented-entries in 'struct'/'union'/'enum'. +nl_ds_struct_enum_cmt = false # true/false + +# Whether to force a newline before '}' of a 'struct'/'union'/'enum'. +# (Lower priority than eat_blanks_before_close_brace.) +nl_ds_struct_enum_close_brace = false # true/false + +# Add or remove newline before or after (depending on pos_class_colon) a class +# colon, as in 'class Foo : public Bar'. +nl_class_colon = ignore # ignore/add/remove/force + +# Add or remove newline around a class constructor colon. The exact position +# depends on nl_constr_init_args, pos_constr_colon and pos_constr_comma. +nl_constr_colon = ignore # ignore/add/remove/force + +# Whether to collapse a two-line namespace, like 'namespace foo\n{ decl; }' +# into a single line. If true, prevents other brace newline rules from turning +# such code into four lines. +nl_namespace_two_to_one_liner = false # true/false + +# Whether to remove a newline in simple unbraced if statements, turning them +# into one-liners, as in 'if(b)\n i++;' => 'if(b) i++;'. +nl_create_if_one_liner = false # true/false + +# Whether to remove a newline in simple unbraced for statements, turning them +# into one-liners, as in 'for (...)\n stmt;' => 'for (...) stmt;'. +nl_create_for_one_liner = false # true/false + +# Whether to remove a newline in simple unbraced while statements, turning +# them into one-liners, as in 'while (expr)\n stmt;' => 'while (expr) stmt;'. +nl_create_while_one_liner = false # true/false + +# Whether to collapse a function definition whose body (not counting braces) +# is only one line so that the entire definition (prototype, braces, body) is +# a single line. +nl_create_func_def_one_liner = false # true/false + +# Whether to collapse a function definition whose body (not counting braces) +# is only one line so that the entire definition (prototype, braces, body) is +# a single line. +nl_create_list_one_liner = false # true/false + +# Whether to split one-line simple unbraced if statements into two lines by +# adding a newline, as in 'if(b) i++;'. +nl_split_if_one_liner = false # true/false + +# Whether to split one-line simple unbraced for statements into two lines by +# adding a newline, as in 'for (...) stmt;'. +nl_split_for_one_liner = false # true/false + +# Whether to split one-line simple unbraced while statements into two lines by +# adding a newline, as in 'while (expr) stmt;'. +nl_split_while_one_liner = false # true/false + +# Don't add a newline before a cpp-comment in a parameter list of a function +# call. +donot_add_nl_before_cpp_comment = false # true/false + +# +# Blank line options +# + +# The maximum number of consecutive newlines (3 = 2 blank lines). +nl_max = 0 # unsigned number + +# The maximum number of consecutive newlines in a function. +nl_max_blank_in_func = 0 # unsigned number + +# The number of newlines inside an empty function body. +# This option is overridden by nl_collapse_empty_body=true +nl_inside_empty_func = 0 # unsigned number + +# The number of newlines before a function prototype. +nl_before_func_body_proto = 0 # unsigned number + +# The number of newlines before a multi-line function definition. +nl_before_func_body_def = 0 # unsigned number + +# The number of newlines before a class constructor/destructor prototype. +nl_before_func_class_proto = 0 # unsigned number + +# The number of newlines before a class constructor/destructor definition. +nl_before_func_class_def = 0 # unsigned number + +# The number of newlines after a function prototype. +nl_after_func_proto = 0 # unsigned number + +# The number of newlines after a function prototype, if not followed by +# another function prototype. +nl_after_func_proto_group = 0 # unsigned number + +# The number of newlines after a class constructor/destructor prototype. +nl_after_func_class_proto = 0 # unsigned number + +# The number of newlines after a class constructor/destructor prototype, +# if not followed by another constructor/destructor prototype. +nl_after_func_class_proto_group = 0 # unsigned number + +# Whether one-line method definitions inside a class body should be treated +# as if they were prototypes for the purposes of adding newlines. +# +# Requires nl_class_leave_one_liners=true. Overrides nl_before_func_body_def +# and nl_before_func_class_def for one-liners. +nl_class_leave_one_liner_groups = false # true/false + +# The number of newlines after '}' of a multi-line function body. +nl_after_func_body = 0 # unsigned number + +# The number of newlines after '}' of a multi-line function body in a class +# declaration. Also affects class constructors/destructors. +# +# Overrides nl_after_func_body. +nl_after_func_body_class = 0 # unsigned number + +# The number of newlines after '}' of a single line function body. Also +# affects class constructors/destructors. +# +# Overrides nl_after_func_body and nl_after_func_body_class. +nl_after_func_body_one_liner = 0 # unsigned number + +# The number of blank lines after a block of variable definitions at the top +# of a function body. +# +# 0: No change (default). +nl_func_var_def_blk = 0 # unsigned number + +# The number of newlines before a block of typedefs. If nl_after_access_spec +# is non-zero, that option takes precedence. +# +# 0: No change (default). +nl_typedef_blk_start = 0 # unsigned number + +# The number of newlines after a block of typedefs. +# +# 0: No change (default). +nl_typedef_blk_end = 0 # unsigned number + +# The maximum number of consecutive newlines within a block of typedefs. +# +# 0: No change (default). +nl_typedef_blk_in = 0 # unsigned number + +# The number of newlines before a block of variable definitions not at the top +# of a function body. If nl_after_access_spec is non-zero, that option takes +# precedence. +# +# 0: No change (default). +nl_var_def_blk_start = 0 # unsigned number + +# The number of newlines after a block of variable definitions not at the top +# of a function body. +# +# 0: No change (default). +nl_var_def_blk_end = 0 # unsigned number + +# The maximum number of consecutive newlines within a block of variable +# definitions. +# +# 0: No change (default). +nl_var_def_blk_in = 0 # unsigned number + +# The minimum number of newlines before a multi-line comment. +# Doesn't apply if after a brace open or another multi-line comment. +nl_before_block_comment = 0 # unsigned number + +# The minimum number of newlines before a single-line C comment. +# Doesn't apply if after a brace open or other single-line C comments. +nl_before_c_comment = 0 # unsigned number + +# The minimum number of newlines before a CPP comment. +# Doesn't apply if after a brace open or other CPP comments. +nl_before_cpp_comment = 0 # unsigned number + +# Whether to force a newline after a multi-line comment. +nl_after_multiline_comment = false # true/false + +# Whether to force a newline after a label's colon. +nl_after_label_colon = false # true/false + +# The number of newlines after '}' or ';' of a struct/enum/union definition. +nl_after_struct = 0 # unsigned number + +# The number of newlines before a class definition. +nl_before_class = 0 # unsigned number + +# The number of newlines after '}' or ';' of a class definition. +nl_after_class = 0 # unsigned number + +# The number of newlines before a namespace. +nl_before_namespace = 0 # unsigned number + +# The number of newlines after '{' of a namespace. This also adds newlines +# before the matching '}'. +# +# 0: Apply eat_blanks_after_open_brace or eat_blanks_before_close_brace if +# applicable, otherwise no change. +# +# Overrides eat_blanks_after_open_brace and eat_blanks_before_close_brace. +nl_inside_namespace = 0 # unsigned number + +# The number of newlines after '}' of a namespace. +nl_after_namespace = 0 # unsigned number + +# The number of newlines before an access specifier label. This also includes +# the Qt-specific 'signals:' and 'slots:'. Will not change the newline count +# if after a brace open. +# +# 0: No change (default). +nl_before_access_spec = 0 # unsigned number + +# The number of newlines after an access specifier label. This also includes +# the Qt-specific 'signals:' and 'slots:'. Will not change the newline count +# if after a brace open. +# +# 0: No change (default). +# +# Overrides nl_typedef_blk_start and nl_var_def_blk_start. +nl_after_access_spec = 0 # unsigned number + +# The number of newlines between a function definition and the function +# comment, as in '// comment\n void foo() {...}'. +# +# 0: No change (default). +nl_comment_func_def = 0 # unsigned number + +# The number of newlines after a try-catch-finally block that isn't followed +# by a brace close. +# +# 0: No change (default). +nl_after_try_catch_finally = 0 # unsigned number + +# (C#) The number of newlines before and after a property, indexer or event +# declaration. +# +# 0: No change (default). +nl_around_cs_property = 0 # unsigned number + +# (C#) The number of newlines between the get/set/add/remove handlers. +# +# 0: No change (default). +nl_between_get_set = 0 # unsigned number + +# (C#) Add or remove newline between property and the '{'. +nl_property_brace = ignore # ignore/add/remove/force + +# Whether to remove blank lines after '{'. +eat_blanks_after_open_brace = false # true/false + +# Whether to remove blank lines before '}'. +eat_blanks_before_close_brace = false # true/false + +# How aggressively to remove extra newlines not in preprocessor. +# +# 0: No change (default) +# 1: Remove most newlines not handled by other config +# 2: Remove all newlines and reformat completely by config +nl_remove_extra_newlines = 0 # unsigned number + +# (Java) Add or remove newline after an annotation statement. Only affects +# annotations that are after a newline. +nl_after_annotation = ignore # ignore/add/remove/force + +# (Java) Add or remove newline between two annotations. +nl_between_annotation = ignore # ignore/add/remove/force + +# The number of newlines before a whole-file #ifdef. +# +# 0: No change (default). +nl_before_whole_file_ifdef = 0 # unsigned number + +# The number of newlines after a whole-file #ifdef. +# +# 0: No change (default). +nl_after_whole_file_ifdef = 0 # unsigned number + +# The number of newlines before a whole-file #endif. +# +# 0: No change (default). +nl_before_whole_file_endif = 0 # unsigned number + +# The number of newlines after a whole-file #endif. +# +# 0: No change (default). +nl_after_whole_file_endif = 0 # unsigned number + +# +# Positioning options +# + +# The position of arithmetic operators in wrapped expressions. +pos_arith = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of assignment in wrapped expressions. Do not affect '=' +# followed by '{'. +pos_assign = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of Boolean operators in wrapped expressions. +pos_bool = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of comparison operators in wrapped expressions. +pos_compare = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of conditional operators, as in the '?' and ':' of +# 'expr ? stmt : stmt', in wrapped expressions. +pos_conditional = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of the comma in wrapped expressions. +pos_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of the comma in enum entries. +pos_enum_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of the comma in the base class list if there is more than one +# line. Affects nl_class_init_args. +pos_class_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of the comma in the constructor initialization list. +# Related to nl_constr_colon, nl_constr_init_args and pos_constr_colon. +pos_constr_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of trailing/leading class colon, between class and base class +# list. Affects nl_class_colon. +pos_class_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of colons between constructor and member initialization. +# Related to nl_constr_colon, nl_constr_init_args and pos_constr_comma. +pos_constr_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# The position of shift operators in wrapped expressions. +pos_shift = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force + +# +# Line splitting options +# + +# Try to limit code width to N columns. +code_width = 0 # unsigned number + +# Whether to fully split long 'for' statements at semi-colons. +ls_for_split_full = false # true/false + +# Whether to fully split long function prototypes/calls at commas. +# The option ls_code_width has priority over the option ls_func_split_full. +ls_func_split_full = false # true/false + +# Whether to split lines as close to code_width as possible and ignore some +# groupings. +# The option ls_code_width has priority over the option ls_func_split_full. +ls_code_width = false # true/false + +# +# Code alignment options (not left column spaces/tabs) +# + +# Whether to keep non-indenting tabs. +align_keep_tabs = false # true/false + +# Whether to use tabs for aligning. +align_with_tabs = false # true/false + +# Whether to bump out to the next tab when aligning. +align_on_tabstop = false # true/false + +# Whether to right-align numbers. +align_number_right = false # true/false + +# Whether to keep whitespace not required for alignment. +align_keep_extra_space = false # true/false + +# Whether to align variable definitions in prototypes and functions. +align_func_params = false # true/false + +# The span for aligning parameter definitions in function on parameter name. +# +# 0: Don't align (default). +align_func_params_span = 0 # unsigned number + +# The threshold for aligning function parameter definitions. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_func_params_thresh = 0 # number + +# The gap for aligning function parameter definitions. +align_func_params_gap = 0 # unsigned number + +# The span for aligning constructor value. +# +# 0: Don't align (default). +align_constr_value_span = 0 # unsigned number + +# The threshold for aligning constructor value. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_constr_value_thresh = 0 # number + +# The gap for aligning constructor value. +align_constr_value_gap = 0 # unsigned number + +# Whether to align parameters in single-line functions that have the same +# name. The function names must already be aligned with each other. +align_same_func_call_params = false # true/false + +# The span for aligning function-call parameters for single line functions. +# +# 0: Don't align (default). +align_same_func_call_params_span = 0 # unsigned number + +# The threshold for aligning function-call parameters for single line +# functions. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_same_func_call_params_thresh = 0 # number + +# The span for aligning variable definitions. +# +# 0: Don't align (default). +align_var_def_span = 0 # unsigned number + +# How to consider (or treat) the '*' in the alignment of variable definitions. +# +# 0: Part of the type 'void * foo;' (default) +# 1: Part of the variable 'void *foo;' +# 2: Dangling 'void *foo;' +# Dangling: the '*' will not be taken into account when aligning. +align_var_def_star_style = 0 # unsigned number + +# How to consider (or treat) the '&' in the alignment of variable definitions. +# +# 0: Part of the type 'long & foo;' (default) +# 1: Part of the variable 'long &foo;' +# 2: Dangling 'long &foo;' +# Dangling: the '&' will not be taken into account when aligning. +align_var_def_amp_style = 0 # unsigned number + +# The threshold for aligning variable definitions. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_var_def_thresh = 0 # number + +# The gap for aligning variable definitions. +align_var_def_gap = 0 # unsigned number + +# Whether to align the colon in struct bit fields. +align_var_def_colon = false # true/false + +# The gap for aligning the colon in struct bit fields. +align_var_def_colon_gap = 0 # unsigned number + +# Whether to align any attribute after the variable name. +align_var_def_attribute = false # true/false + +# Whether to align inline struct/enum/union variable definitions. +align_var_def_inline = false # true/false + +# The span for aligning on '=' in assignments. +# +# 0: Don't align (default). +align_assign_span = 0 # unsigned number + +# The span for aligning on '=' in function prototype modifier. +# +# 0: Don't align (default). +align_assign_func_proto_span = 0 # unsigned number + +# The threshold for aligning on '=' in assignments. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_assign_thresh = 0 # number + +# How to apply align_assign_span to function declaration "assignments", i.e. +# 'virtual void foo() = 0' or '~foo() = {default|delete}'. +# +# 0: Align with other assignments (default) +# 1: Align with each other, ignoring regular assignments +# 2: Don't align +align_assign_decl_func = 0 # unsigned number + +# The span for aligning on '=' in enums. +# +# 0: Don't align (default). +align_enum_equ_span = 0 # unsigned number + +# The threshold for aligning on '=' in enums. +# Use a negative number for absolute thresholds. +# +# 0: no limit (default). +align_enum_equ_thresh = 0 # number + +# The span for aligning class member definitions. +# +# 0: Don't align (default). +align_var_class_span = 0 # unsigned number + +# The threshold for aligning class member definitions. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_var_class_thresh = 0 # number + +# The gap for aligning class member definitions. +align_var_class_gap = 0 # unsigned number + +# The span for aligning struct/union member definitions. +# +# 0: Don't align (default). +align_var_struct_span = 0 # unsigned number + +# The threshold for aligning struct/union member definitions. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_var_struct_thresh = 0 # number + +# The gap for aligning struct/union member definitions. +align_var_struct_gap = 0 # unsigned number + +# The span for aligning struct initializer values. +# +# 0: Don't align (default). +align_struct_init_span = 0 # unsigned number + +# The span for aligning single-line typedefs. +# +# 0: Don't align (default). +align_typedef_span = 0 # unsigned number + +# The minimum space between the type and the synonym of a typedef. +align_typedef_gap = 0 # unsigned number + +# How to align typedef'd functions with other typedefs. +# +# 0: Don't mix them at all (default) +# 1: Align the open parenthesis with the types +# 2: Align the function type name with the other type names +align_typedef_func = 0 # unsigned number + +# How to consider (or treat) the '*' in the alignment of typedefs. +# +# 0: Part of the typedef type, 'typedef int * pint;' (default) +# 1: Part of type name: 'typedef int *pint;' +# 2: Dangling: 'typedef int *pint;' +# Dangling: the '*' will not be taken into account when aligning. +align_typedef_star_style = 0 # unsigned number + +# How to consider (or treat) the '&' in the alignment of typedefs. +# +# 0: Part of the typedef type, 'typedef int & intref;' (default) +# 1: Part of type name: 'typedef int &intref;' +# 2: Dangling: 'typedef int &intref;' +# Dangling: the '&' will not be taken into account when aligning. +align_typedef_amp_style = 0 # unsigned number + +# The span for aligning comments that end lines. +# +# 0: Don't align (default). +align_right_cmt_span = 0 # unsigned number + +# Minimum number of columns between preceding text and a trailing comment in +# order for the comment to qualify for being aligned. Must be non-zero to have +# an effect. +align_right_cmt_gap = 0 # unsigned number + +# If aligning comments, whether to mix with comments after '}' and #endif with +# less than three spaces before the comment. +align_right_cmt_mix = false # true/false + +# Whether to only align trailing comments that are at the same brace level. +align_right_cmt_same_level = false # true/false + +# Minimum column at which to align trailing comments. Comments which are +# aligned beyond this column, but which can be aligned in a lesser column, +# may be "pulled in". +# +# 0: Ignore (default). +align_right_cmt_at_col = 0 # unsigned number + +# The span for aligning function prototypes. +# +# 0: Don't align (default). +align_func_proto_span = 0 # unsigned number + +# The threshold for aligning function prototypes. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_func_proto_thresh = 0 # number + +# Minimum gap between the return type and the function name. +align_func_proto_gap = 0 # unsigned number + +# Whether to align function prototypes on the 'operator' keyword instead of +# what follows. +align_on_operator = false # true/false + +# Whether to mix aligning prototype and variable declarations. If true, +# align_var_def_XXX options are used instead of align_func_proto_XXX options. +align_mix_var_proto = false # true/false + +# Whether to align single-line functions with function prototypes. +# Uses align_func_proto_span. +align_single_line_func = false # true/false + +# Whether to align the open brace of single-line functions. +# Requires align_single_line_func=true. Uses align_func_proto_span. +align_single_line_brace = false # true/false + +# Gap for align_single_line_brace. +align_single_line_brace_gap = 0 # unsigned number + +# (OC) The span for aligning Objective-C message specifications. +# +# 0: Don't align (default). +align_oc_msg_spec_span = 0 # unsigned number + +# Whether to align macros wrapped with a backslash and a newline. This will +# not work right if the macro contains a multi-line comment. +align_nl_cont = false # true/false + +# Whether to align macro functions and variables together. +align_pp_define_together = false # true/false + +# The span for aligning on '#define' bodies. +# +# =0: Don't align (default) +# >0: Number of lines (including comments) between blocks +align_pp_define_span = 0 # unsigned number + +# The minimum space between label and value of a preprocessor define. +align_pp_define_gap = 0 # unsigned number + +# Whether to align lines that start with '<<' with previous '<<'. +# +# Default: true +align_left_shift = true # true/false + +# Whether to align comma-separated statements following '<<' (as used to +# initialize Eigen matrices). +align_eigen_comma_init = false # true/false + +# Whether to align text after 'asm volatile ()' colons. +align_asm_colon = false # true/false + +# (OC) Span for aligning parameters in an Objective-C message call +# on the ':'. +# +# 0: Don't align. +align_oc_msg_colon_span = 0 # unsigned number + +# (OC) Whether to always align with the first parameter, even if it is too +# short. +align_oc_msg_colon_first = false # true/false + +# (OC) Whether to align parameters in an Objective-C '+' or '-' declaration +# on the ':'. +align_oc_decl_colon = false # true/false + +# (OC) Whether to not align parameters in an Objectve-C message call if first +# colon is not on next line of the message call (the same way Xcode does +# aligment) +align_oc_msg_colon_xcode_like = false # true/false + +# +# Comment modification options +# + +# Try to wrap comments at N columns. +cmt_width = 0 # unsigned number + +# How to reflow comments. +# +# 0: No reflowing (apart from the line wrapping due to cmt_width) (default) +# 1: No touching at all +# 2: Full reflow +cmt_reflow_mode = 0 # unsigned number + +# Whether to convert all tabs to spaces in comments. If false, tabs in +# comments are left alone, unless used for indenting. +cmt_convert_tab_to_spaces = false # true/false + +# Whether to apply changes to multi-line comments, including cmt_width, +# keyword substitution and leading chars. +# +# Default: true +cmt_indent_multi = true # true/false + +# Whether to group c-comments that look like they are in a block. +cmt_c_group = false # true/false + +# Whether to put an empty '/*' on the first line of the combined c-comment. +cmt_c_nl_start = false # true/false + +# Whether to add a newline before the closing '*/' of the combined c-comment. +cmt_c_nl_end = false # true/false + +# Whether to change cpp-comments into c-comments. +cmt_cpp_to_c = false # true/false + +# Whether to group cpp-comments that look like they are in a block. Only +# meaningful if cmt_cpp_to_c=true. +cmt_cpp_group = false # true/false + +# Whether to put an empty '/*' on the first line of the combined cpp-comment +# when converting to a c-comment. +# +# Requires cmt_cpp_to_c=true and cmt_cpp_group=true. +cmt_cpp_nl_start = false # true/false + +# Whether to add a newline before the closing '*/' of the combined cpp-comment +# when converting to a c-comment. +# +# Requires cmt_cpp_to_c=true and cmt_cpp_group=true. +cmt_cpp_nl_end = false # true/false + +# Whether to put a star on subsequent comment lines. +cmt_star_cont = false # true/false + +# The number of spaces to insert at the start of subsequent comment lines. +cmt_sp_before_star_cont = 0 # unsigned number + +# The number of spaces to insert after the star on subsequent comment lines. +cmt_sp_after_star_cont = 0 # unsigned number + +# For multi-line comments with a '*' lead, remove leading spaces if the first +# and last lines of the comment are the same length. +# +# Default: true +cmt_multi_check_last = true # true/false + +# For multi-line comments with a '*' lead, remove leading spaces if the first +# and last lines of the comment are the same length AND if the length is +# bigger as the first_len minimum. +# +# Default: 4 +cmt_multi_first_len_minimum = 4 # unsigned number + +# Path to a file that contains text to insert at the beginning of a file if +# the file doesn't start with a C/C++ comment. If the inserted text contains +# '$(filename)', that will be replaced with the current file's name. +cmt_insert_file_header = "" # string + +# Path to a file that contains text to insert at the end of a file if the +# file doesn't end with a C/C++ comment. If the inserted text contains +# '$(filename)', that will be replaced with the current file's name. +cmt_insert_file_footer = "" # string + +# Path to a file that contains text to insert before a function definition if +# the function isn't preceded by a C/C++ comment. If the inserted text +# contains '$(function)', '$(javaparam)' or '$(fclass)', these will be +# replaced with, respectively, the name of the function, the javadoc '@param' +# and '@return' stuff, or the name of the class to which the member function +# belongs. +cmt_insert_func_header = "" # string + +# Path to a file that contains text to insert before a class if the class +# isn't preceded by a C/C++ comment. If the inserted text contains '$(class)', +# that will be replaced with the class name. +cmt_insert_class_header = "" # string + +# Path to a file that contains text to insert before an Objective-C message +# specification, if the method isn't preceded by a C/C++ comment. If the +# inserted text contains '$(message)' or '$(javaparam)', these will be +# replaced with, respectively, the name of the function, or the javadoc +# '@param' and '@return' stuff. +cmt_insert_oc_msg_header = "" # string + +# Whether a comment should be inserted if a preprocessor is encountered when +# stepping backwards from a function name. +# +# Applies to cmt_insert_oc_msg_header, cmt_insert_func_header and +# cmt_insert_class_header. +cmt_insert_before_preproc = false # true/false + +# Whether a comment should be inserted if a function is declared inline to a +# class definition. +# +# Applies to cmt_insert_func_header. +# +# Default: true +cmt_insert_before_inlines = true # true/false + +# Whether a comment should be inserted if the function is a class constructor +# or destructor. +# +# Applies to cmt_insert_func_header. +cmt_insert_before_ctor_dtor = false # true/false + +# +# Code modifying options (non-whitespace) +# + +# Add or remove braces on a single-line 'do' statement. +mod_full_brace_do = ignore # ignore/add/remove/force + +# Add or remove braces on a single-line 'for' statement. +mod_full_brace_for = ignore # ignore/add/remove/force + +# (Pawn) Add or remove braces on a single-line function definition. +mod_full_brace_function = ignore # ignore/add/remove/force + +# Add or remove braces on a single-line 'if' statement. Braces will not be +# removed if the braced statement contains an 'else'. +mod_full_brace_if = ignore # ignore/add/remove/force + +# Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either +# have, or do not have, braces. If true, braces will be added if any block +# needs braces, and will only be removed if they can be removed from all +# blocks. +# +# Overrides mod_full_brace_if. +mod_full_brace_if_chain = false # true/false + +# Whether to add braces to all blocks of an 'if'/'else if'/'else' chain. +# If true, mod_full_brace_if_chain will only remove braces from an 'if' that +# does not have an 'else if' or 'else'. +mod_full_brace_if_chain_only = false # true/false + +# Add or remove braces on single-line 'while' statement. +mod_full_brace_while = ignore # ignore/add/remove/force + +# Add or remove braces on single-line 'using ()' statement. +mod_full_brace_using = ignore # ignore/add/remove/force + +# Don't remove braces around statements that span N newlines +mod_full_brace_nl = 0 # unsigned number + +# Whether to prevent removal of braces from 'if'/'for'/'while'/etc. blocks +# which span multiple lines. +# +# Affects: +# mod_full_brace_for +# mod_full_brace_if +# mod_full_brace_if_chain +# mod_full_brace_if_chain_only +# mod_full_brace_while +# mod_full_brace_using +# +# Does not affect: +# mod_full_brace_do +# mod_full_brace_function +mod_full_brace_nl_block_rem_mlcond = false # true/false + +# Add or remove unnecessary parenthesis on 'return' statement. +mod_paren_on_return = ignore # ignore/add/remove/force + +# (Pawn) Whether to change optional semicolons to real semicolons. +mod_pawn_semicolon = false # true/false + +# Whether to fully parenthesize Boolean expressions in 'while' and 'if' +# statement, as in 'if (a && b > c)' => 'if (a && (b > c))'. +mod_full_paren_if_bool = false # true/false + +# Whether to remove superfluous semicolons. +mod_remove_extra_semicolon = false # true/false + +# If a function body exceeds the specified number of newlines and doesn't have +# a comment after the close brace, a comment will be added. +mod_add_long_function_closebrace_comment = 0 # unsigned number + +# If a namespace body exceeds the specified number of newlines and doesn't +# have a comment after the close brace, a comment will be added. +mod_add_long_namespace_closebrace_comment = 0 # unsigned number + +# If a class body exceeds the specified number of newlines and doesn't have a +# comment after the close brace, a comment will be added. +mod_add_long_class_closebrace_comment = 0 # unsigned number + +# If a switch body exceeds the specified number of newlines and doesn't have a +# comment after the close brace, a comment will be added. +mod_add_long_switch_closebrace_comment = 0 # unsigned number + +# If an #ifdef body exceeds the specified number of newlines and doesn't have +# a comment after the #endif, a comment will be added. +mod_add_long_ifdef_endif_comment = 0 # unsigned number + +# If an #ifdef or #else body exceeds the specified number of newlines and +# doesn't have a comment after the #else, a comment will be added. +mod_add_long_ifdef_else_comment = 0 # unsigned number + +# Whether to take care of the case by the mod_sort_xx options. +mod_sort_case_sensitive = false # true/false + +# Whether to sort consecutive single-line 'import' statements. +mod_sort_import = false # true/false + +# (C#) Whether to sort consecutive single-line 'using' statements. +mod_sort_using = false # true/false + +# Whether to sort consecutive single-line '#include' statements (C/C++) and +# '#import' statements (Objective-C). Be aware that this has the potential to +# break your code if your includes/imports have ordering dependencies. +mod_sort_include = false # true/false + +# Whether to prioritize '#include' and '#import' statements that contain +# filename without extension when sorting is enabled. +mod_sort_incl_import_prioritize_filename = false # true/false + +# Whether to prioritize '#include' and '#import' statements that does not +# contain extensions when sorting is enabled. +mod_sort_incl_import_prioritize_extensionless = false # true/false + +# Whether to prioritize '#include' and '#import' statements that contain +# angle over quotes when sorting is enabled. +mod_sort_incl_import_prioritize_angle_over_quotes = false # true/false + +# Whether to ignore file extension in '#include' and '#import' statements +# for sorting comparison. +mod_sort_incl_import_ignore_extension = false # true/false + +# Whether to group '#include' and '#import' statements when sorting is enabled. +mod_sort_incl_import_grouping_enabled = false # true/false + +# Whether to move a 'break' that appears after a fully braced 'case' before +# the close brace, as in 'case X: { ... } break;' => 'case X: { ... break; }'. +mod_move_case_break = false # true/false + +# Add or remove braces around a fully braced case statement. Will only remove +# braces if there are no variable declarations in the block. +mod_case_brace = ignore # ignore/add/remove/force + +# Whether to remove a void 'return;' that appears as the last statement in a +# function. +mod_remove_empty_return = false # true/false + +# Add or remove the comma after the last value of an enumeration. +mod_enum_last_comma = ignore # ignore/add/remove/force + +# (OC) Whether to organize the properties. If true, properties will be +# rearranged according to the mod_sort_oc_property_*_weight factors. +mod_sort_oc_properties = false # true/false + +# (OC) Weight of a class property modifier. +mod_sort_oc_property_class_weight = 0 # number + +# (OC) Weight of 'atomic' and 'nonatomic'. +mod_sort_oc_property_thread_safe_weight = 0 # number + +# (OC) Weight of 'readwrite' when organizing properties. +mod_sort_oc_property_readwrite_weight = 0 # number + +# (OC) Weight of a reference type specifier ('retain', 'copy', 'assign', +# 'weak', 'strong') when organizing properties. +mod_sort_oc_property_reference_weight = 0 # number + +# (OC) Weight of getter type ('getter=') when organizing properties. +mod_sort_oc_property_getter_weight = 0 # number + +# (OC) Weight of setter type ('setter=') when organizing properties. +mod_sort_oc_property_setter_weight = 0 # number + +# (OC) Weight of nullability type ('nullable', 'nonnull', 'null_unspecified', +# 'null_resettable') when organizing properties. +mod_sort_oc_property_nullability_weight = 0 # number + +# +# Preprocessor options +# + +# Add or remove indentation of preprocessor directives inside #if blocks +# at brace level 0 (file-level). +pp_indent = ignore # ignore/add/remove/force + +# Whether to indent #if/#else/#endif at the brace level. If false, these are +# indented from column 1. +pp_indent_at_level = false # true/false + +# Specifies the number of columns to indent preprocessors per level +# at brace level 0 (file-level). If pp_indent_at_level=false, also specifies +# the number of columns to indent preprocessors per level +# at brace level > 0 (function-level). +# +# Default: 1 +pp_indent_count = 1 # unsigned number + +# Add or remove space after # based on pp_level of #if blocks. +pp_space = ignore # ignore/add/remove/force + +# Sets the number of spaces per level added with pp_space. +pp_space_count = 0 # unsigned number + +# The indent for '#region' and '#endregion' in C# and '#pragma region' in +# C/C++. Negative values decrease indent down to the first column. +pp_indent_region = 0 # number + +# Whether to indent the code between #region and #endregion. +pp_region_indent_code = false # true/false + +# If pp_indent_at_level=true, sets the indent for #if, #else and #endif when +# not at file-level. Negative values decrease indent down to the first column. +# +# =0: Indent preprocessors using output_tab_size +# >0: Column at which all preprocessors will be indented +pp_indent_if = 0 # number + +# Whether to indent the code between #if, #else and #endif. +pp_if_indent_code = false # true/false + +# Whether to indent '#define' at the brace level. If false, these are +# indented from column 1. +pp_define_at_level = false # true/false + +# Whether to ignore the '#define' body while formatting. +pp_ignore_define_body = false # true/false + +# Whether to indent case statements between #if, #else, and #endif. +# Only applies to the indent of the preprocesser that the case statements +# directly inside of. +# +# Default: true +pp_indent_case = true # true/false + +# Whether to indent whole function definitions between #if, #else, and #endif. +# Only applies to the indent of the preprocesser that the function definition +# is directly inside of. +# +# Default: true +pp_indent_func_def = true # true/false + +# Whether to indent extern C blocks between #if, #else, and #endif. +# Only applies to the indent of the preprocesser that the extern block is +# directly inside of. +# +# Default: true +pp_indent_extern = true # true/false + +# Whether to indent braces directly inside #if, #else, and #endif. +# Only applies to the indent of the preprocesser that the braces are directly +# inside of. +# +# Default: true +pp_indent_brace = true # true/false + +# +# Sort includes options +# + +# The regex for include category with priority 0. +include_category_0 = "" # string + +# The regex for include category with priority 1. +include_category_1 = "" # string + +# The regex for include category with priority 2. +include_category_2 = "" # string + +# +# Use or Do not Use options +# + +# true: indent_func_call_param will be used (default) +# false: indent_func_call_param will NOT be used +# +# Default: true +use_indent_func_call_param = true # true/false + +# The value of the indentation for a continuation line is calculated +# differently if the statement is: +# - a declaration: your case with QString fileName ... +# - an assignment: your case with pSettings = new QSettings( ... +# +# At the second case the indentation value might be used twice: +# - at the assignment +# - at the function call (if present) +# +# To prevent the double use of the indentation value, use this option with the +# value 'true'. +# +# true: indent_continue will be used only once +# false: indent_continue will be used every time (default) +use_indent_continue_only_once = false # true/false + +# The value might be used twice: +# - at the assignment +# - at the opening brace +# +# To prevent the double use of the indentation value, use this option with the +# value 'true'. +# +# true: indentation will be used only once +# false: indentation will be used every time (default) +indent_cpp_lambda_only_once = false # true/false + +# Whether sp_after_angle takes precedence over sp_inside_fparen. This was the +# historic behavior, but is probably not the desired behavior, so this is off +# by default. +use_sp_after_angle_always = false # true/false + +# Whether to apply special formatting for Qt SIGNAL/SLOT macros. Essentially, +# this tries to format these so that they match Qt's normalized form (i.e. the +# result of QMetaObject::normalizedSignature), which can slightly improve the +# performance of the QObject::connect call, rather than how they would +# otherwise be formatted. +# +# See options_for_QT.cpp for details. +# +# Default: true +use_options_overriding_for_qt_macros = true # true/false + +# If true: the form feed character is removed from the list +# of whitespace characters. +# See https://en.cppreference.com/w/cpp/string/byte/isspace +use_form_feed_no_more_as_whitespace_character = false # true/false + +# +# Warn levels - 1: error, 2: warning (default), 3: note +# + +# (C#) Warning is given if doing tab-to-\t replacement and we have found one +# in a C# verbatim string literal. +# +# Default: 2 +warn_level_tabs_found_in_verbatim_string_literals = 2 # unsigned number + +# Limit the number of loops. +# Used by uncrustify.cpp to exit from infinite loop. +# 0: no limit. +debug_max_number_of_loops = 0 # number + +# Set the number of the line to protocol; +# Used in the function prot_the_line if the 2. parameter is zero. +# 0: nothing protocol. +debug_line_number_to_protocol = 0 # number + +# Set the number of second(s) before terminating formatting the current file, +# 0: no timeout. +# only for linux +debug_timeout = 0 # number + +# Meaning of the settings: +# Ignore - do not do any changes +# Add - makes sure there is 1 or more space/brace/newline/etc +# Force - makes sure there is exactly 1 space/brace/newline/etc, +# behaves like Add in some contexts +# Remove - removes space/brace/newline/etc +# +# +# - Token(s) can be treated as specific type(s) with the 'set' option: +# `set tokenType tokenString [tokenString...]` +# +# Example: +# `set BOOL __AND__ __OR__` +# +# tokenTypes are defined in src/token_enum.h, use them without the +# 'CT_' prefix: 'CT_BOOL' => 'BOOL' +# +# +# - Token(s) can be treated as type(s) with the 'type' option. +# `type tokenString [tokenString...]` +# +# Example: +# `type int c_uint_8 Rectangle` +# +# This can also be achieved with `set TYPE int c_uint_8 Rectangle` +# +# +# To embed whitespace in tokenStrings use the '\' escape character, or quote +# the tokenStrings. These quotes are supported: "'` +# +# +# - Support for the auto detection of languages through the file ending can be +# added using the 'file_ext' command. +# `file_ext langType langString [langString..]` +# +# Example: +# `file_ext CPP .ch .cxx .cpp.in` +# +# langTypes are defined in uncrusify_types.h in the lang_flag_e enum, use +# them without the 'LANG_' prefix: 'LANG_CPP' => 'CPP' +# +# +# - Custom macro-based indentation can be set up using 'macro-open', +# 'macro-else' and 'macro-close'. +# `(macro-open | macro-else | macro-close) tokenString` +# +# Example: +# `macro-open BEGIN_TEMPLATE_MESSAGE_MAP` +# `macro-open BEGIN_MESSAGE_MAP` +# `macro-close END_MESSAGE_MAP` +# +# +# option(s) with 'not default' value: 0 +# From 680e56c52a001e72b80fdfe7277ccc9f95f1e961 Mon Sep 17 00:00:00 2001 From: m1cha1s Date: Fri, 25 Nov 2022 14:09:35 +0100 Subject: [PATCH 150/357] Changed creator id --- ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk index 221543547c..7aa352e16e 100644 --- a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk +++ b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk @@ -1,4 +1,4 @@ -CIRCUITPY_CREATOR_ID = 0x0000239A +CIRCUITPY_CREATOR_ID = 0xB0D00000 CIRCUITPY_CREATION_ID = 0x00320002 IDF_TARGET = esp32 From 54f37c3e5a2426738b77817ee4ab2898d144ac69 Mon Sep 17 00:00:00 2001 From: Clay Date: Fri, 25 Nov 2022 04:45:34 +0000 Subject: [PATCH 151/357] Translated using Weblate (Russian) Currently translated at 31.9% (318 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ru/ --- locale/ru.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/locale/ru.po b/locale/ru.po index a575f05a40..99720416ff 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-04-06 13:37+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2022-11-26 04:48+0000\n" +"Last-Translator: Clay \n" "Language-Team: none\n" "Language: ru\n" "MIME-Version: 1.0\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.12-dev\n" +"X-Generator: Weblate 4.15-dev\n" #: main.c msgid "" @@ -31,6 +31,8 @@ msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"Программа остановлена автоматической перезагрузкой. Скоро перезагрузка.\n" #: supervisor/shared/safe_mode.c msgid "" From 2c479f4fceff522d0cfdf1e8be0a554ba2c54d92 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 26 Nov 2022 11:00:09 -0600 Subject: [PATCH 152/357] working on None behavior --- shared-module/displayio/Display.c | 10 ++++++---- shared-module/displayio/display_core.c | 11 ++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 780c4a9136..58f91fcf82 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -144,19 +144,21 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, // } // mp_printf(&mp_plat_print, *circuitpython_splash); // mp_printf(&mp_plat_print, "\n"); - common_hal_displayio_display_show(self, &circuitpython_splash); + //common_hal_displayio_display_show(self, &circuitpython_splash); common_hal_displayio_display_set_auto_refresh(self, auto_refresh); } void is_null(displayio_group_t *root_group){ if (root_group == NULL){ - mp_printf(&mp_plat_print, "root_group is null\n"); + mp_printf(&mp_plat_print, "root_group is NULL\n"); + }else{ + mp_printf(&mp_plat_print, "root_group not NULL"); } } bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group) { if(root_group == NULL){ - mp_printf(&mp_plat_print, "Its NULL fer flucks snakes\n"); + mp_printf(&mp_plat_print, "Its NULL inside display.show()\n"); } return displayio_display_core_set_root_group(&self->core, root_group); } @@ -446,7 +448,7 @@ void release_display(displayio_display_obj_t *self) { void reset_display(displayio_display_obj_t *self) { common_hal_displayio_display_set_auto_refresh(self, true); - common_hal_displayio_display_show(self, NULL); + common_hal_displayio_display_show(self, &circuitpython_splash); } void displayio_display_collect_ptrs(displayio_display_obj_t *self) { diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 635694914f..ba931f82a4 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -165,14 +165,15 @@ void displayio_display_core_set_rotation(displayio_display_core_t *self, bool displayio_display_core_set_root_group(displayio_display_core_t *self, displayio_group_t *root_group) { if (root_group == NULL) { // set the display to the REPL, reset REPL position and size - circuitpython_splash.in_group = false; + //circuitpython_splash.in_group = false; // force the circuit_python_splash out of any group (Note: could cause problems with the parent group) - circuitpython_splash.x = 0; // reset position in case someone moved it. - circuitpython_splash.y = 0; + //circuitpython_splash.x = 0; // reset position in case someone moved it. + //circuitpython_splash.y = 0; mp_printf(&mp_plat_print, "Inside set root group NULL\n"); - supervisor_start_terminal(self->width, self->height); + //supervisor_start_terminal(self->width, self->height); + + //root_group = &circuitpython_splash; - root_group = &circuitpython_splash; } if (root_group == self->current_group) { return true; From 738b73d4b49bdb60a344d66799b1920bf3848206 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 27 Nov 2022 13:54:53 -0600 Subject: [PATCH 153/357] check for NULL in fill_area. moved start_terminal to reset_display. --- shared-module/displayio/Display.c | 27 ++++++-------------------- shared-module/displayio/display_core.c | 17 ++++++---------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 58f91fcf82..b06ffa97d6 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -136,30 +136,12 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, // Set the group after initialization otherwise we may send pixels while we delay in // initialization. - mp_printf(&mp_plat_print, "Inside display make_new\n"); - is_null(&circuitpython_splash); - //is_null(0); -// if(circuitpython_splash == mp_const_none) { -// mp_printf(&mp_plat_print, "Splash is NULL \n"); -// } -// mp_printf(&mp_plat_print, *circuitpython_splash); -// mp_printf(&mp_plat_print, "\n"); - //common_hal_displayio_display_show(self, &circuitpython_splash); + + common_hal_displayio_display_set_root_group(self, &circuitpython_splash); common_hal_displayio_display_set_auto_refresh(self, auto_refresh); } -void is_null(displayio_group_t *root_group){ - if (root_group == NULL){ - mp_printf(&mp_plat_print, "root_group is NULL\n"); - }else{ - mp_printf(&mp_plat_print, "root_group not NULL"); - } -} - bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group) { - if(root_group == NULL){ - mp_printf(&mp_plat_print, "Its NULL inside display.show()\n"); - } return displayio_display_core_set_root_group(&self->core, root_group); } @@ -448,7 +430,10 @@ void release_display(displayio_display_obj_t *self) { void reset_display(displayio_display_obj_t *self) { common_hal_displayio_display_set_auto_refresh(self, true); - common_hal_displayio_display_show(self, &circuitpython_splash); + circuitpython_splash.x = 0; // reset position in case someone moved it. + circuitpython_splash.y = 0; + supervisor_start_terminal(self->core.width, self->core.height); + common_hal_displayio_display_set_root_group(self, &circuitpython_splash); } void displayio_display_collect_ptrs(displayio_display_obj_t *self) { diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index ba931f82a4..1e33a5f7e9 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -164,16 +164,8 @@ void displayio_display_core_set_rotation(displayio_display_core_t *self, bool displayio_display_core_set_root_group(displayio_display_core_t *self, displayio_group_t *root_group) { - if (root_group == NULL) { // set the display to the REPL, reset REPL position and size - //circuitpython_splash.in_group = false; - // force the circuit_python_splash out of any group (Note: could cause problems with the parent group) - //circuitpython_splash.x = 0; // reset position in case someone moved it. - //circuitpython_splash.y = 0; - mp_printf(&mp_plat_print, "Inside set root group NULL\n"); - //supervisor_start_terminal(self->width, self->height); - - //root_group = &circuitpython_splash; - + if (root_group == NULL) { + // Show nothing on the display } if (root_group == self->current_group) { return true; @@ -367,7 +359,10 @@ void displayio_display_core_collect_ptrs(displayio_display_core_t *self) { } bool displayio_display_core_fill_area(displayio_display_core_t *self, displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { - return displayio_group_fill_area(self->current_group, &self->colorspace, area, mask, buffer); + if(self->current_group != NULL){ + return displayio_group_fill_area(self->current_group, &self->colorspace, area, mask, buffer); + } + return false; } bool displayio_display_core_clip_area(displayio_display_core_t *self, const displayio_area_t *area, displayio_area_t *clipped) { From 15a9e63fda71fea11be1d212d2e5ee3189b6b805 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 27 Nov 2022 14:08:38 -0600 Subject: [PATCH 154/357] remove is_null troubleshooting function. remove empty line --- shared-module/displayio/Display.c | 1 - shared-module/displayio/Display.h | 1 - 2 files changed, 2 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index b06ffa97d6..6103bfaf53 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -136,7 +136,6 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, // Set the group after initialization otherwise we may send pixels while we delay in // initialization. - common_hal_displayio_display_set_root_group(self, &circuitpython_splash); common_hal_displayio_display_set_auto_refresh(self, auto_refresh); } diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index eb356a388c..c60adc482f 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -64,7 +64,6 @@ typedef struct { void displayio_display_background(displayio_display_obj_t *self); void release_display(displayio_display_obj_t *self); void reset_display(displayio_display_obj_t *self); -void is_null(displayio_group_t *root_group); void displayio_display_collect_ptrs(displayio_display_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_DISPLAY_H From 6844dc0cb79232fb69b765b73254344e644a7bfe Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 27 Nov 2022 14:20:15 -0600 Subject: [PATCH 155/357] code format, extra space --- shared-module/displayio/display_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 1e33a5f7e9..2cd9c18cb9 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -359,7 +359,7 @@ void displayio_display_core_collect_ptrs(displayio_display_core_t *self) { } bool displayio_display_core_fill_area(displayio_display_core_t *self, displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { - if(self->current_group != NULL){ + if (self->current_group != NULL){ return displayio_group_fill_area(self->current_group, &self->colorspace, area, mask, buffer); } return false; From 0f3695d0f4b34741bb4d5e08f6ff16be306dfb98 Mon Sep 17 00:00:00 2001 From: Bernhard Bablok Date: Sun, 27 Nov 2022 21:24:44 +0100 Subject: [PATCH 156/357] initial commit --- .devcontainer/Readme.md | 31 +++++++++++++ .devcontainer/cortex-m/devcontainer.json | 23 +++++++++ .devcontainer/cortex-m/on-create.sh | 59 ++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 .devcontainer/Readme.md create mode 100644 .devcontainer/cortex-m/devcontainer.json create mode 100755 .devcontainer/cortex-m/on-create.sh diff --git a/.devcontainer/Readme.md b/.devcontainer/Readme.md new file mode 100644 index 0000000000..00acbb5786 --- /dev/null +++ b/.devcontainer/Readme.md @@ -0,0 +1,31 @@ +Build CircuitPython in a Github-Devcontainer +============================================ + +To build CircuitPython within a Github-Devcontainer, you need to perform +the following steps. + + 1. checkout the code to a devcontainer + + - click on the green "<> Code"-button + - select the Codespaces-tab + - choose "+ new with options..." from the "..."-menu + - in the following screen select the branch and then + - select ".devcontainer/cortex-m/devcontainer.json" instead + of "Default Codespaces configuration" + - update region as necessary + - finally, click on the green "Create codespace" button + + 2. Your codespace is created. Cloning the images is quite fast, but + preparing it for CircuitPython-development takes about 10 minutes. + Note that this is a one-time task. + + 3. During creation, you can run the command + `tail -f /workspaces/.codespaces/.persistedshare/creation.log` + to see what is going on. + + 4. To actually build CircuitPython, run + + cd ports/raspberrypi + make -j $(nproc) BOARD=whatever TRANSLATION=xx_XX + + This takes about 2m40s. diff --git a/.devcontainer/cortex-m/devcontainer.json b/.devcontainer/cortex-m/devcontainer.json new file mode 100644 index 0000000000..796f83a4eb --- /dev/null +++ b/.devcontainer/cortex-m/devcontainer.json @@ -0,0 +1,23 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/universal +{ + "name": "CircuitPython Cortex-M Build-Environment (base: Default Linux Universal)", + "image": "mcr.microsoft.com/devcontainers/universal:2-linux", + "postCreateCommand": ".devcontainer/cortex-mq/on-create.sh", + "remoteEnv": { "PATH": "/workspaces/gcc-arm-none-eabi/bin:${containerEnv:PATH}" } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/cortex-m/on-create.sh b/.devcontainer/cortex-m/on-create.sh new file mode 100755 index 0000000000..8c4bd0cfed --- /dev/null +++ b/.devcontainer/cortex-m/on-create.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# on-create.sh: postCreateCommand-hook for devcontainer.json (Cortex-M build) +# +# Author: Bernhard Bablok +# +# ----------------------------------------------------------------------------- + +echo -e "[on-create.sh] downloading and installing gcc-arm-non-eabi toolchain" +cd /workspaces +wget -qO gcc-arm-none-eabi.tar.bz2 https://adafru.it/Pid +tar -xjf gcc-arm-none-eabi.tar.bz2 +ln -s gcc-arm-none-eabi-10-2020-q4-major gcc-arm-none-eabi +rm -f /workspaces/gcc-arm-none-eabi.tar.bz2 +export PATH=/workspaces/gcc-arm-none-eabi/bin:$PATH + +# add repository and install tools +echo -e "[on-create.sh] adding pybricks/ppa" +sudo add-apt-repository -y ppa:pybricks/ppa +echo -e "[on-create.sh] installing uncrustify and mtools" +sudo apt-get -y install uncrustify mtools + +# dosfstools >= 4.2 needed, standard repo only has 4.1 +echo -e "[on-create.sh] downloading and installing dosfstools" +wget https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz +tar -xzf dosfstools-4.2.tar.gz +cd dosfstools-4.2/ +./configure +make -j $(nproc) +sudo make install +cd /workspaces +rm -fr /workspaces/dosfstools-4.2 /workspaces/dosfstools-4.2.tar.gz + +# prepare source-code tree +cd /workspaces/circuitpython/ +echo -e "[on-create.sh] fetching submodules" +make fetch-submodules +echo -e "[on-create.sh] fetching tags" +git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD + +# additional python requirements +echo -e "[on-create.sh] pip-installing requirements" +pip install --upgrade -r requirements-dev.txt +pip install --upgrade -r requirements-doc.txt + +# add pre-commit +echo -e "[on-create.sh] installing pre-commit" +pre-commit install + +# create cross-compiler +echo -e "[on-create.sh] building mpy-cross" +make -j $(nproc) -C mpy-cross # time: about 36 sec + +# that's it! +echo -e "[on-create.sh] setup complete" + +#commands to actually build CP: +#cd ports/raspberrypi +#time make -j $(nproc) BOARD=pimoroni_tufty2040 TRANSLATION=de_DE From 3419b118fdf194d47bae143197a286a77c244d01 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 27 Nov 2022 17:02:55 -0600 Subject: [PATCH 157/357] fix out of range Co-authored-by: Mark <56205165+gamblor21@users.noreply.github.com> --- shared-module/_pixelmap/PixelMap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/_pixelmap/PixelMap.c b/shared-module/_pixelmap/PixelMap.c index d20a6dd03c..7599f31f0e 100644 --- a/shared-module/_pixelmap/PixelMap.c +++ b/shared-module/_pixelmap/PixelMap.c @@ -34,7 +34,7 @@ static void pixelmap_set_pixel_rgbw(pixelmap_pixelmap_obj_t *self, size_t i, color_u rgbw) { - mp_arg_validate_index_range(i, 0, self->len, MP_QSTR_index); + mp_arg_validate_index_range(i, 0, self->len - 1, MP_QSTR_index); mp_obj_t item = self->items[i]; if (mp_obj_is_small_int(item)) { From 52be2b80c15a4a1825234e45b949831fdcff3e76 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 27 Nov 2022 17:04:25 -0600 Subject: [PATCH 158/357] fix out of range Co-authored-by: Mark <56205165+gamblor21@users.noreply.github.com> --- shared-module/_pixelmap/PixelMap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/_pixelmap/PixelMap.c b/shared-module/_pixelmap/PixelMap.c index 7599f31f0e..14d07e12fb 100644 --- a/shared-module/_pixelmap/PixelMap.c +++ b/shared-module/_pixelmap/PixelMap.c @@ -165,7 +165,7 @@ void shared_module_pixelmap_pixelmap_setitem(pixelmap_pixelmap_obj_t *self, mp_i } mp_obj_t shared_module_pixelmap_pixelmap_getitem(pixelmap_pixelmap_obj_t *self, mp_int_t i) { - mp_arg_validate_index_range(i, 0, self->len, MP_QSTR_index); + mp_arg_validate_index_range(i, 0, self->len - 1, MP_QSTR_index); mp_obj_t item = self->items[i]; if (mp_obj_is_small_int(item)) { return common_hal_adafruit_pixelbuf_pixelbuf_get_pixel(self->pixelbuf, MP_OBJ_SMALL_INT_VALUE(item)); From b8d6605cff992c008e8aa6cab2638b65972fb1e0 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 27 Nov 2022 17:26:46 -0600 Subject: [PATCH 159/357] code format, extra space --- shared-module/displayio/display_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 2cd9c18cb9..c21d87316d 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -359,8 +359,8 @@ void displayio_display_core_collect_ptrs(displayio_display_core_t *self) { } bool displayio_display_core_fill_area(displayio_display_core_t *self, displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { - if (self->current_group != NULL){ - return displayio_group_fill_area(self->current_group, &self->colorspace, area, mask, buffer); + if (self->current_group != NULL) { + return displayio_group_fill_area(self->current_group,&self->colorspace, area, mask, buffer); } return false; } From 553d48f887fd5af8d33532417e39a05e4dbbae86 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 28 Nov 2022 09:03:03 -0600 Subject: [PATCH 160/357] return None for NULL --- shared-module/displayio/Display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 6103bfaf53..a640d10fd3 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -206,6 +206,9 @@ mp_obj_t common_hal_displayio_display_get_bus(displayio_display_obj_t *self) { } mp_obj_t common_hal_displayio_display_get_root_group(displayio_display_obj_t *self) { + if (self->core.current_group == NULL) { + return mp_const_none; + } return self->core.current_group; } From 0a59b6560a5d4969db28c67ccaed326e5e5cfa17 Mon Sep 17 00:00:00 2001 From: Bernhard Bablok Date: Mon, 28 Nov 2022 19:40:09 +0100 Subject: [PATCH 161/357] added .devcontainer/* to exclude_patterns --- conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conf.py b/conf.py index 90f58979d9..55be66373a 100644 --- a/conf.py +++ b/conf.py @@ -171,6 +171,7 @@ exclude_patterns = ["**/build*", ".env", ".venv", ".direnv", + ".devcontainer/*", "data", "docs/autoapi", "docs/README.md", From e1c025d6dde584445ae7e8cd089722254407cda5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Nov 2022 13:30:08 -0600 Subject: [PATCH 162/357] Fix documentation of wifi.Monitor Its methods & properties were incorrectly documented as being directly in 'wifi' --- shared-bindings/wifi/Monitor.c | 48 ++++++++++++++++------------------ 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/shared-bindings/wifi/Monitor.c b/shared-bindings/wifi/Monitor.c index bd688d357d..d087ec587b 100644 --- a/shared-bindings/wifi/Monitor.c +++ b/shared-bindings/wifi/Monitor.c @@ -36,15 +36,14 @@ //| """For monitoring WiFi packets.""" //| -//| def __init__(self, channel: Optional[int] = 1, queue: Optional[int] = 128) -> None: -//| """Initialize `wifi.Monitor` singleton. +//| def __init__(self, channel: Optional[int] = 1, queue: Optional[int] = 128) -> None: +//| """Initialize `wifi.Monitor` singleton. //| -//| :param int channel: The WiFi channel to scan. -//| :param int queue: The queue size for buffering the packet. -//| -//| """ -//| ... +//| :param int channel: The WiFi channel to scan. +//| :param int queue: The queue size for buffering the packet. //| +//| """ +//| ... STATIC mp_obj_t wifi_monitor_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { enum { ARG_channel, ARG_queue }; static const mp_arg_t allowed_args[] = { @@ -69,8 +68,8 @@ STATIC mp_obj_t wifi_monitor_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| channel: int -//| """The WiFi channel to scan.""" +//| channel: int +//| """The WiFi channel to scan.""" STATIC mp_obj_t wifi_monitor_obj_get_channel(mp_obj_t self_in) { return common_hal_wifi_monitor_get_channel(self_in); } @@ -90,8 +89,8 @@ MP_PROPERTY_GETSET(wifi_monitor_channel_obj, (mp_obj_t)&wifi_monitor_get_channel_obj, (mp_obj_t)&wifi_monitor_set_channel_obj); -//| queue: int -//| """The queue size for buffering the packet.""" +//| queue: int +//| """The queue size for buffering the packet.""" STATIC mp_obj_t wifi_monitor_obj_get_queue(mp_obj_t self_in) { return common_hal_wifi_monitor_get_queue(self_in); } @@ -100,29 +99,26 @@ MP_DEFINE_CONST_FUN_OBJ_1(wifi_monitor_get_queue_obj, wifi_monitor_obj_get_queue MP_PROPERTY_GETTER(wifi_monitor_queue_obj, (mp_obj_t)&wifi_monitor_get_queue_obj); -//| def deinit(self) -> None: -//| """De-initialize `wifi.Monitor` singleton.""" -//| ... -//| +//| def deinit(self) -> None: +//| """De-initialize `wifi.Monitor` singleton.""" +//| ... STATIC mp_obj_t wifi_monitor_obj_deinit(mp_obj_t self_in) { common_hal_wifi_monitor_deinit(self_in); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_monitor_deinit_obj, wifi_monitor_obj_deinit); -//| def lost(self) -> int: -//| """Returns the packet loss count. The counter resets after each poll.""" -//| ... -//| +//| def lost(self) -> int: +//| """Returns the packet loss count. The counter resets after each poll.""" +//| ... STATIC mp_obj_t wifi_monitor_obj_get_lost(mp_obj_t self_in) { return common_hal_wifi_monitor_get_lost(self_in); } MP_DEFINE_CONST_FUN_OBJ_1(wifi_monitor_lost_obj, wifi_monitor_obj_get_lost); -//| def queued(self) -> int: -//| """Returns the packet queued count.""" -//| ... -//| +//| def queued(self) -> int: +//| """Returns the packet queued count.""" +//| ... STATIC mp_obj_t wifi_monitor_obj_get_queued(mp_obj_t self_in) { if (common_hal_wifi_monitor_deinited()) { return mp_obj_new_int_from_uint(0); @@ -131,9 +127,9 @@ STATIC mp_obj_t wifi_monitor_obj_get_queued(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_monitor_queued_obj, wifi_monitor_obj_get_queued); -//| def packet(self) -> dict: -//| """Returns the monitor packet.""" -//| ... +//| def packet(self) -> dict: +//| """Returns the monitor packet.""" +//| ... //| STATIC mp_obj_t wifi_monitor_obj_get_packet(mp_obj_t self_in) { if (common_hal_wifi_monitor_deinited()) { From fba71010ac853cb441988cb2cb3fe1eea2764762 Mon Sep 17 00:00:00 2001 From: Bernhard Bablok Date: Mon, 28 Nov 2022 21:09:57 +0100 Subject: [PATCH 163/357] be more specific with exclude_patterns --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 55be66373a..7b3b4ca585 100644 --- a/conf.py +++ b/conf.py @@ -171,7 +171,7 @@ exclude_patterns = ["**/build*", ".env", ".venv", ".direnv", - ".devcontainer/*", + ".devcontainer/Readme.md", "data", "docs/autoapi", "docs/README.md", From aef55b7e41ee8ac14fee902b09b028ead4a89962 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Nov 2022 16:56:28 -0600 Subject: [PATCH 164/357] Add SocketPool.gaierror gaierror(-2) is raised in the failure case of getaddrinfo. This is compatible with cpython's socket module. Typical session: ``` >>> import socketpool >>> import wifi >>> socket = socketpool.SocketPool(wifi.radio) >>> try: socket.getaddrinfo("boo", 0) ... except socket.gaierror as e: ee = e ... >>> type(ee) >>> ee.errno == socket.EAI_NONAME True >>> ee.strerror 'Name or service not known' >>> raise ee Traceback (most recent call last): File "", line 1, in File "", line 1, in gaierror: (-2, 'Name or service not known') ``` Closes: #6941 --- shared-bindings/socketpool/SocketPool.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 097cb4f39a..4881a0597b 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -36,6 +36,8 @@ #include "shared-bindings/socketpool/Socket.h" #include "shared-bindings/socketpool/SocketPool.h" +#define SOCKETPOOL_EAI_NONAME (-2) + //| class SocketPool: //| """A pool of socket resources available for the given radio. Only one //| SocketPool can be created for each radio. @@ -63,12 +65,20 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(s); } + +//| class gaierror(OSError): +//| """Errors raised by getaddrinfo""" +//| +MP_DEFINE_EXCEPTION(gaierror, OSError) + +//| //| AF_INET: int //| AF_INET6: int //| //| SOCK_STREAM: int //| SOCK_DGRAM: int //| SOCK_RAW: int +//| EAI_NONAME: int //| //| TCP_NODELAY: int //| @@ -145,7 +155,11 @@ STATIC mp_obj_t socketpool_socketpool_getaddrinfo(size_t n_args, const mp_obj_t } if (ip_str == mp_const_none) { - mp_raise_OSError(-2); // socket.EAI_NONAME from CPython + mp_obj_t exc_args[2] = { + MP_OBJ_NEW_SMALL_INT(SOCKETPOOL_EAI_NONAME), + MP_OBJ_NEW_QSTR(MP_QSTR_Name_space_or_space_service_space_not_space_known), + }; + nlr_raise(mp_obj_new_exception_args(&mp_type_gaierror, 2, exc_args)); } mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(5, NULL)); @@ -164,6 +178,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_getaddrinfo_obj, 1, sock STATIC const mp_rom_map_elem_t socketpool_socketpool_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_socket), MP_ROM_PTR(&socketpool_socketpool_socket_obj) }, { MP_ROM_QSTR(MP_QSTR_getaddrinfo), MP_ROM_PTR(&socketpool_socketpool_getaddrinfo_obj) }, + { MP_ROM_QSTR(MP_QSTR_gaierror), MP_ROM_PTR(&mp_type_gaierror) }, // class constants { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(SOCKETPOOL_AF_INET) }, @@ -176,6 +191,8 @@ STATIC const mp_rom_map_elem_t socketpool_socketpool_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_TCP_NODELAY), MP_ROM_INT(SOCKETPOOL_TCP_NODELAY) }, { MP_ROM_QSTR(MP_QSTR_IPPROTO_TCP), MP_ROM_INT(SOCKETPOOL_IPPROTO_TCP) }, + + { MP_ROM_QSTR(MP_QSTR_EAI_NONAME), MP_ROM_INT(SOCKETPOOL_EAI_NONAME) }, }; STATIC MP_DEFINE_CONST_DICT(socketpool_socketpool_locals_dict, socketpool_socketpool_locals_dict_table); From 1bbdc820c0784c736c7fe98db7252beea47b396e Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 28 Nov 2022 17:02:46 -0600 Subject: [PATCH 165/357] make show(None) show the terminal --- shared-module/displayio/Display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index a640d10fd3..1f7891dc17 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -141,6 +141,9 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, } bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group) { + if (root_group == NULL) { + return displayio_display_core_set_root_group(&self->core, &circuitpython_splash); + } return displayio_display_core_set_root_group(&self->core, root_group); } From c13ca95da1c8a59a18f628891595a7e50fed5d0b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 22 Nov 2022 17:10:54 -0800 Subject: [PATCH 166/357] Add MDNS support to Pico W This adds both cpy-MAC.local and circuitpython.local support. Fixes #7214 --- .gitmodules | 6 +- locale/circuitpython.pot | 13 +- ports/raspberrypi/Makefile | 1 + .../raspberry_pi_pico_w/mpconfigboard.mk | 2 +- .../common-hal/mdns/RemoteService.c | 64 ++++ .../common-hal/mdns/RemoteService.h | 40 +++ ports/raspberrypi/common-hal/mdns/Server.c | 307 ++++++++++++++++++ ports/raspberrypi/common-hal/mdns/Server.h | 40 +++ ports/raspberrypi/common-hal/mdns/__init__.c | 1 + ports/raspberrypi/common-hal/wifi/Radio.c | 8 +- ports/raspberrypi/lib/cyw43-driver | 2 +- ports/raspberrypi/lib/lwip | 2 +- ports/raspberrypi/lwip_inc/lwipopts.h | 9 + shared-bindings/wifi/Radio.c | 4 +- shared-bindings/wifi/Radio.h | 2 + supervisor/shared/web_workflow/web_workflow.c | 63 ++-- 16 files changed, 521 insertions(+), 43 deletions(-) create mode 100644 ports/raspberrypi/common-hal/mdns/RemoteService.c create mode 100644 ports/raspberrypi/common-hal/mdns/RemoteService.h create mode 100644 ports/raspberrypi/common-hal/mdns/Server.c create mode 100644 ports/raspberrypi/common-hal/mdns/Server.h create mode 100644 ports/raspberrypi/common-hal/mdns/__init__.c diff --git a/.gitmodules b/.gitmodules index f13eb79e45..ae413799c7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -312,10 +312,12 @@ url = https://github.com/adafruit/esp32-camera/ [submodule "ports/raspberrypi/lib/cyw43-driver"] path = ports/raspberrypi/lib/cyw43-driver - url = https://github.com/georgerobotics/cyw43-driver.git + url = https://github.com/adafruit/cyw43-driver.git + branch = circuitpython8 [submodule "ports/raspberrypi/lib/lwip"] path = ports/raspberrypi/lib/lwip - url = https://github.com/lwip-tcpip/lwip.git + url = https://github.com/adafruit/lwip.git + branch = circuitpython8 [submodule "lib/mbedtls"] path = lib/mbedtls url = https://github.com/ARMmbed/mbedtls.git diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 044900bd30..09c7ed61bd 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -106,7 +106,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -171,7 +171,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1663,6 +1663,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2192,6 +2196,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3153,7 +3158,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3405,10 +3410,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 44d74f2bd4..acecd68c58 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -47,6 +47,7 @@ SRC_SDK_CYW43 := \ SRC_LWIP := \ shared/netutils/netutils.c \ + $(wildcard lib/lwip/src/apps/mdns/*.c) \ $(wildcard lib/lwip/src/core/*.c) \ $(wildcard lib/lwip/src/core/ipv4/*.c) \ lib/lwip/src/netif/ethernet.c \ diff --git a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk index f36fdd6ec7..a050391505 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk +++ b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.mk @@ -15,7 +15,7 @@ CIRCUITPY_SSL = 1 CIRCUITPY_SSL_MBEDTLS = 1 CIRCUITPY_HASHLIB = 1 CIRCUITPY_WEB_WORKFLOW = 1 -CIRCUITPY_MDNS = 0 +CIRCUITPY_MDNS = 1 CIRCUITPY_SOCKETPOOL = 1 CIRCUITPY_WIFI = 1 diff --git a/ports/raspberrypi/common-hal/mdns/RemoteService.c b/ports/raspberrypi/common-hal/mdns/RemoteService.c new file mode 100644 index 0000000000..071a9c1648 --- /dev/null +++ b/ports/raspberrypi/common-hal/mdns/RemoteService.c @@ -0,0 +1,64 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "shared-bindings/mdns/RemoteService.h" + +#include "shared-bindings/ipaddress/IPv4Address.h" + +const char *common_hal_mdns_remoteservice_get_service_type(mdns_remoteservice_obj_t *self) { + return self->service_name; +} + +const char *common_hal_mdns_remoteservice_get_protocol(mdns_remoteservice_obj_t *self) { + return self->protocol; +} + +const char *common_hal_mdns_remoteservice_get_instance_name(mdns_remoteservice_obj_t *self) { + return self->instance_name; +} + +const char *common_hal_mdns_remoteservice_get_hostname(mdns_remoteservice_obj_t *self) { + return self->hostname; +} + +mp_int_t common_hal_mdns_remoteservice_get_port(mdns_remoteservice_obj_t *self) { + return self->port; +} + +uint32_t mdns_remoteservice_get_ipv4_address(mdns_remoteservice_obj_t *self) { + return self->ipv4_address; +} + +mp_obj_t common_hal_mdns_remoteservice_get_ipv4_address(mdns_remoteservice_obj_t *self) { + uint32_t addr = mdns_remoteservice_get_ipv4_address(self); + if (addr == 0) { + return mp_const_none; + } + return common_hal_ipaddress_new_ipv4address(addr); +} + +void common_hal_mdns_remoteservice_deinit(mdns_remoteservice_obj_t *self) { +} diff --git a/ports/raspberrypi/common-hal/mdns/RemoteService.h b/ports/raspberrypi/common-hal/mdns/RemoteService.h new file mode 100644 index 0000000000..06814f0fbb --- /dev/null +++ b/ports/raspberrypi/common-hal/mdns/RemoteService.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#pragma once + +#include "lwip/apps/mdns.h" + +typedef struct { + mp_obj_base_t base; + uint32_t ipv4_address; + uint16_t port; + char protocol[5]; // RFC 6763 Section 7.2 - 4 bytes + 1 for NUL + char service_name[17]; // RFC 6763 Section 7.2 - 16 bytes + 1 for NUL + char instance_name[64]; // RFC 6763 Section 7.2 - 63 bytes + 1 for NUL + char hostname[64]; // RFC 6762 Appendix A - 63 bytes for label + 1 for NUL + mp_obj_t next; +} mdns_remoteservice_obj_t; diff --git a/ports/raspberrypi/common-hal/mdns/Server.c b/ports/raspberrypi/common-hal/mdns/Server.c new file mode 100644 index 0000000000..72aedf3889 --- /dev/null +++ b/ports/raspberrypi/common-hal/mdns/Server.c @@ -0,0 +1,307 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "shared-bindings/mdns/Server.h" + +#include "py/gc.h" +#include "py/runtime.h" +#include "shared/runtime/interrupt_char.h" +#include "shared-bindings/mdns/RemoteService.h" +#include "shared-bindings/wifi/__init__.h" +#include "supervisor/shared/tick.h" + +#include "lwip/apps/mdns.h" +#include "lwip/prot/dns.h" + +STATIC bool inited = false; + +#define NETIF_STA (&cyw43_state.netif[CYW43_ITF_STA]) +#define NETIF_AP (&cyw43_state.netif[CYW43_ITF_AP]) + +void mdns_server_construct(mdns_server_obj_t *self, bool workflow) { + if (inited) { + return; + } + + mdns_resp_init(); + inited = true; + + uint8_t mac[6]; + wifi_radio_get_mac_address(&common_hal_wifi_radio_obj, mac); + snprintf(self->default_hostname, sizeof(self->default_hostname), "cpy-%02x%02x%02x", mac[3], mac[4], mac[5]); + common_hal_mdns_server_set_hostname(self, self->default_hostname); + + if (workflow) { + // Add a second host entry to respond to "circuitpython.local" queries as well. + + #if MDNS_MAX_SECONDARY_HOSTNAMES > 0 + mdns_resp_add_secondary_hostname(NETIF_STA, "circuitpython"); + #endif + } +} + +void common_hal_mdns_server_construct(mdns_server_obj_t *self, mp_obj_t network_interface) { + if (network_interface != MP_OBJ_FROM_PTR(&common_hal_wifi_radio_obj)) { + mp_raise_ValueError(translate("mDNS only works with built-in WiFi")); + return; + } + if (inited) { + mp_raise_RuntimeError(translate("mDNS already initialized")); + } + mdns_server_construct(self, false); +} + +void common_hal_mdns_server_deinit(mdns_server_obj_t *self) { + inited = false; + mdns_resp_remove_netif(NETIF_STA); +} + +bool common_hal_mdns_server_deinited(mdns_server_obj_t *self) { + return !mdns_resp_netif_active(NETIF_STA); +} + +const char *common_hal_mdns_server_get_hostname(mdns_server_obj_t *self) { + return self->hostname; +} + +void common_hal_mdns_server_set_hostname(mdns_server_obj_t *self, const char *hostname) { + if (mdns_resp_netif_active(NETIF_STA)) { + mdns_resp_rename_netif(NETIF_STA, hostname); + } else { + mdns_resp_add_netif(NETIF_STA, hostname); + } + + self->hostname = hostname; +} + +const char *common_hal_mdns_server_get_instance_name(mdns_server_obj_t *self) { + return self->instance_name; +} + +void common_hal_mdns_server_set_instance_name(mdns_server_obj_t *self, const char *instance_name) { + self->instance_name = instance_name; +} + +typedef struct { + uint8_t request_id; + size_t i; + mdns_remoteservice_obj_t *out; + size_t out_len; +} nonalloc_search_state_t; + +STATIC void copy_data_into_remote_service(struct mdns_answer *answer, const char *varpart, int varlen, mdns_remoteservice_obj_t *out) { + if (varlen > 0) { + if (answer->info.type == DNS_RRTYPE_A) { + char *hostname = out->hostname; + size_t len = MIN(63, answer->info.domain.name[0]); + memcpy(hostname, answer->info.domain.name + 1, len); + hostname[len] = '\0'; + out->ipv4_address = varpart[0] | varpart[1] << 8 | varpart[2] << 16 | varpart[3] << 24; + } + if (answer->info.type == DNS_RRTYPE_SRV) { + // This isn't a null terminated string. Its length encoded. + uint8_t *domain = answer->info.domain.name; + char *instance_name = out->instance_name; + size_t offset = 0; + uint8_t iname_len = domain[offset++]; + size_t len = MIN(63, iname_len); + memcpy(instance_name, domain + offset, len); + offset += iname_len; + instance_name[len] = '\0'; + + uint8_t sn_len = domain[offset++]; + char *service_name = out->service_name; + len = MIN(16, sn_len); + memcpy(service_name, domain + offset, len); + offset += sn_len; + service_name[len] = '\0'; + + uint8_t proto_len = domain[offset++]; + char *protocol = out->protocol; + len = MIN(4, proto_len); + memcpy(protocol, domain + offset, len); + offset += proto_len; + protocol[len] = '\0'; + + out->port = varpart[4] << 8 | varpart[5]; + } + } +} + +STATIC void search_result_cb(struct mdns_answer *answer, const char *varpart, int varlen, int flags, void *arg) { + nonalloc_search_state_t *state = arg; + state->out[state->i].base.type = &mdns_remoteservice_type; + + copy_data_into_remote_service(answer, varpart, varlen, &state->out[state->i]); + + if ((flags & MDNS_SEARCH_RESULT_LAST) != 0) { + state->i += 1; + } + + if (state->i == state->out_len) { + mdns_search_stop(state->request_id); + state->request_id = MDNS_MAX_REQUESTS; + } +} + +size_t mdns_server_find(mdns_server_obj_t *self, const char *service_type, const char *protocol, + mp_float_t timeout, mdns_remoteservice_obj_t *out, size_t out_len) { + + enum mdns_sd_proto proto = DNSSD_PROTO_UDP; + if (strcmp(protocol, "_tcp") == 0) { + proto = DNSSD_PROTO_TCP; + } + + nonalloc_search_state_t state; + state.i = 0; + state.out = out; + state.out_len = out_len; + + err_t err = mdns_search_service(NULL, service_type, proto, + NETIF_STA, &search_result_cb, &state, + &state.request_id); + if (err != ERR_OK) { + return 0; + } + + uint64_t start_ticks = supervisor_ticks_ms64(); + uint64_t timeout_ms = timeout * 1000; + + while (state.request_id < MDNS_MAX_REQUESTS && + !mp_hal_is_interrupted() && + supervisor_ticks_ms64() - start_ticks < timeout_ms) { + RUN_BACKGROUND_TASKS; + } + if (state.request_id < MDNS_MAX_REQUESTS) { + mdns_search_stop(state.request_id); + state.request_id = MDNS_MAX_REQUESTS; + } + + return state.i; +} + +typedef struct { + uint8_t request_id; + mdns_remoteservice_obj_t *head; + size_t count; +} alloc_search_state_t; + +STATIC void alloc_search_result_cb(struct mdns_answer *answer, const char *varpart, int varlen, int flags, void *arg) { + alloc_search_state_t *state = arg; + + if ((flags & MDNS_SEARCH_RESULT_FIRST) != 0) { + // first + mdns_remoteservice_obj_t *service = gc_alloc(sizeof(mdns_remoteservice_obj_t), 0, false); + mp_printf(&mp_plat_print, "found service %p\n", service); + if (service == NULL) { + // alloc fails + mdns_search_stop(state->request_id); + state->request_id = MDNS_MAX_REQUESTS; + if (state->count == 0) { + m_malloc_fail(sizeof(mdns_remoteservice_obj_t)); + } + return; + } + service->base.type = &mdns_remoteservice_type; + state->count++; + service->next = state->head; + state->head = service; + } + + copy_data_into_remote_service(answer, varpart, varlen, state->head); +} + +mp_obj_t common_hal_mdns_server_find(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_float_t timeout) { + enum mdns_sd_proto proto = DNSSD_PROTO_UDP; + if (strcmp(protocol, "_tcp") == 0) { + proto = DNSSD_PROTO_TCP; + } + + alloc_search_state_t state; + state.count = 0; + state.head = NULL; + + err_t err = mdns_search_service(NULL, service_type, proto, + NETIF_STA, &alloc_search_result_cb, &state, + &state.request_id); + if (err != ERR_OK) { + mp_raise_RuntimeError(translate("Unable to start mDNS query")); + } + + uint64_t start_ticks = supervisor_ticks_ms64(); + uint64_t timeout_ms = timeout * 1000; + + while (state.request_id < MDNS_MAX_REQUESTS && + !mp_hal_is_interrupted() && + supervisor_ticks_ms64() - start_ticks < timeout_ms) { + RUN_BACKGROUND_TASKS; + } + if (state.request_id < MDNS_MAX_REQUESTS) { + mdns_search_stop(state.request_id); + state.request_id = MDNS_MAX_REQUESTS; + } + + mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(state.count, NULL)); + mdns_remoteservice_obj_t *next = state.head; + uint8_t added = 0; + while (next != NULL) { + mdns_remoteservice_obj_t *cur = next; + tuple->items[added] = MP_OBJ_FROM_PTR(cur); + next = cur->next; + // Set next back to NULL so that each service object is independently + // tracked for GC. + cur->next = NULL; + added++; + } + + return MP_OBJ_FROM_PTR(tuple); +} + +void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_int_t port) { + enum mdns_sd_proto proto = DNSSD_PROTO_UDP; + if (strcmp(protocol, "_tcp") == 0) { + proto = DNSSD_PROTO_TCP; + } + // Remove the existing service if it was already added. + int8_t existing_slot = MDNS_MAX_SERVICES; + for (int i = 0; i < MDNS_MAX_SERVICES; i++) { + if (self->service_type[i] != NULL && + (service_type == self->service_type[i] || + strcmp(service_type, self->service_type[i]) == 0)) { + existing_slot = i; + break; + } + } + if (existing_slot < MDNS_MAX_SERVICES) { + mdns_resp_del_service(NETIF_STA, existing_slot); + } + int8_t slot = mdns_resp_add_service(NETIF_STA, self->instance_name, service_type, proto, port, NULL, NULL); + if (slot < 0) { + mp_raise_RuntimeError(translate("Out of MDNS service slots")); + return; + } + self->service_type[slot] = service_type; +} diff --git a/ports/raspberrypi/common-hal/mdns/Server.h b/ports/raspberrypi/common-hal/mdns/Server.h new file mode 100644 index 0000000000..8f28d74d3c --- /dev/null +++ b/ports/raspberrypi/common-hal/mdns/Server.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#pragma once + +#include "py/obj.h" + +#include "lwip/apps/mdns_opts.h" + +typedef struct { + mp_obj_base_t base; + const char *hostname; + const char *instance_name; + // "cpy-" "XXXXXX" "\0" + char default_hostname[4 + 6 + 1]; + const char *service_type[MDNS_MAX_SERVICES]; +} mdns_server_obj_t; diff --git a/ports/raspberrypi/common-hal/mdns/__init__.c b/ports/raspberrypi/common-hal/mdns/__init__.c new file mode 100644 index 0000000000..57740777c8 --- /dev/null +++ b/ports/raspberrypi/common-hal/mdns/__init__.c @@ -0,0 +1 @@ +// No mdns module functions. diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index ae8f64e595..7fe03024f2 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -42,10 +42,6 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/ipaddress/__init__.h" -#if CIRCUITPY_MDNS -#include "components/mdns/include/mdns.h" -#endif - #include "lwip/sys.h" #include "lwip/dns.h" #include "lwip/icmp.h" @@ -95,6 +91,10 @@ void common_hal_wifi_radio_set_hostname(wifi_radio_obj_t *self, const char *host netif_set_hostname(NETIF_AP, self->hostname); } +void wifi_radio_get_mac_address(wifi_radio_obj_t *self, uint8_t *mac) { + memcpy(mac, cyw43_state.mac, MAC_ADDRESS_LENGTH); +} + mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) { return mp_obj_new_bytes(cyw43_state.mac, MAC_ADDRESS_LENGTH); } diff --git a/ports/raspberrypi/lib/cyw43-driver b/ports/raspberrypi/lib/cyw43-driver index 195dfcc10b..746e063603 160000 --- a/ports/raspberrypi/lib/cyw43-driver +++ b/ports/raspberrypi/lib/cyw43-driver @@ -1 +1 @@ -Subproject commit 195dfcc10bb6f379e3dea45147590db2203d3c7b +Subproject commit 746e0636033d0550b7652688124a77a6a1639cf9 diff --git a/ports/raspberrypi/lib/lwip b/ports/raspberrypi/lib/lwip index 239918ccc1..d26459c32c 160000 --- a/ports/raspberrypi/lib/lwip +++ b/ports/raspberrypi/lib/lwip @@ -1 +1 @@ -Subproject commit 239918ccc173cb2c2a62f41a40fd893f57faf1d6 +Subproject commit d26459c32c83aa14a6d4e30237d91cee36e0adbd diff --git a/ports/raspberrypi/lwip_inc/lwipopts.h b/ports/raspberrypi/lwip_inc/lwipopts.h index 0d4ecd3707..6d116e89b6 100644 --- a/ports/raspberrypi/lwip_inc/lwipopts.h +++ b/ports/raspberrypi/lwip_inc/lwipopts.h @@ -54,6 +54,14 @@ #define LWIP_DHCP_DOES_ACD_CHECK 0 #define SO_REUSE 1 +#if CIRCUITPY_MDNS +#define LWIP_IGMP 1 +#define LWIP_MDNS_RESPONDER 1 +#define LWIP_NUM_NETIF_CLIENT_DATA 1 +#define LWIP_NETIF_EXT_STATUS_CALLBACK 1 +#define MDNS_MAX_SECONDARY_HOSTNAMES 1 +#endif + #ifndef NDEBUG #define LWIP_DEBUG 1 #define LWIP_STATS 1 @@ -88,6 +96,7 @@ #define PPP_DEBUG LWIP_DBG_OFF #define SLIP_DEBUG LWIP_DBG_OFF #define DHCP_DEBUG LWIP_DBG_OFF +#define MDNS_DEBUG LWIP_DBG_OFF #define LWIP_TIMEVAL_PRIVATE 0 diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 37123dbb44..c12e19e726 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -140,11 +140,11 @@ MP_PROPERTY_GETSET(wifi_radio_hostname_obj, //| mac_address: ReadableBuffer //| """MAC address for the station. When the address is altered after interface is connected //| the changes would only be reflected once the interface reconnects.""" -STATIC mp_obj_t wifi_radio_get_mac_address(mp_obj_t self_in) { +STATIC mp_obj_t _wifi_radio_get_mac_address(mp_obj_t self_in) { wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); return MP_OBJ_FROM_PTR(common_hal_wifi_radio_get_mac_address(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_mac_address_obj, wifi_radio_get_mac_address); +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_mac_address_obj, _wifi_radio_get_mac_address); STATIC mp_obj_t wifi_radio_set_mac_address(mp_obj_t self_in, mp_obj_t mac_address_in) { mp_buffer_info_t mac_address; diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 407443c77e..dbaeb9cce8 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -77,6 +77,8 @@ extern void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabl extern mp_obj_t common_hal_wifi_radio_get_hostname(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_set_hostname(wifi_radio_obj_t *self, const char *hostname); + +extern void wifi_radio_get_mac_address(wifi_radio_obj_t *self, uint8_t *mac); extern mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const uint8_t *mac); extern mp_obj_t common_hal_wifi_radio_get_mac_address_ap(wifi_radio_obj_t *self); diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 2d6025b6aa..3527090f1e 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -428,7 +428,6 @@ static bool _endswith(const char *str, const char *suffix) { } const char *ok_hosts[] = { - "code.circuitpython.org", "127.0.0.1", "localhost", }; @@ -1393,38 +1392,44 @@ static void _process_request(socketpool_socket_obj_t *socket, _request *request) void supervisor_web_workflow_background(void) { - // If we have a request in progress, continue working on it. Do this first - // so that we can accept another socket after finishing this request. - if (common_hal_socketpool_socket_get_connected(&active)) { - _process_request(&active, &active_request); - } else { - // Close the active socket if it is no longer connected. - common_hal_socketpool_socket_close(&active); - } - - // Otherwise, see if we have another socket to accept. - if ((!common_hal_socketpool_socket_get_connected(&active) || - (!active_request.in_progress && !active_request.new_socket)) && - !common_hal_socketpool_socket_get_closed(&listening)) { - uint32_t ip; - uint32_t port; - int newsoc = socketpool_socket_accept(&listening, (uint8_t *)&ip, &port, &active); - if (newsoc == -EBADF) { - common_hal_socketpool_socket_close(&listening); - return; + // Track if we have more to do. For example, we should start processing a + // request immediately after we accept the socket. + bool more_to_do = true; + while (more_to_do) { + more_to_do = false; + // If we have a request in progress, continue working on it. Do this first + // so that we can accept another socket after finishing this request. + if (common_hal_socketpool_socket_get_connected(&active)) { + _process_request(&active, &active_request); + } else { + // Close the active socket if it is no longer connected. + common_hal_socketpool_socket_close(&active); } - if (newsoc > 0) { - common_hal_socketpool_socket_settimeout(&active, 0); - _reset_request(&active_request); - // Mark new sockets, otherwise we may accept another before the first - // could start its request. - active_request.new_socket = true; + // Otherwise, see if we have another socket to accept. + if ((!common_hal_socketpool_socket_get_connected(&active) || + (!active_request.in_progress && !active_request.new_socket)) && + !common_hal_socketpool_socket_get_closed(&listening)) { + uint32_t ip; + uint32_t port; + int newsoc = socketpool_socket_accept(&listening, (uint8_t *)&ip, &port, &active); + if (newsoc == -EBADF) { + common_hal_socketpool_socket_close(&listening); + return; + } + if (newsoc > 0) { + common_hal_socketpool_socket_settimeout(&active, 0); + + _reset_request(&active_request); + // Mark new sockets, otherwise we may accept another before the first + // could start its request. + active_request.new_socket = true; + more_to_do = true; + } } + + websocket_background(); } - - - websocket_background(); } void supervisor_stop_web_workflow(void) { From f3100af6ac1074124237ebef2bacd93dded76fb9 Mon Sep 17 00:00:00 2001 From: Clay Date: Mon, 28 Nov 2022 06:39:34 +0000 Subject: [PATCH 167/357] Translated using Weblate (Russian) Currently translated at 35.2% (351 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ru/ --- locale/ru.po | 126 +++++++++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 55 deletions(-) diff --git a/locale/ru.po b/locale/ru.po index 99720416ff..2871aa465e 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-11-26 04:48+0000\n" +"PO-Revision-Date: 2022-11-29 01:02+0000\n" "Last-Translator: Clay \n" "Language-Team: none\n" "Language: ru\n" @@ -73,13 +73,13 @@ msgstr "%%c требует int или char" #: main.c #, c-format msgid "%02X" -msgstr "" +msgstr "%02X" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" -msgstr "%d адресные пины, %d rgb пины и %d плитки указывают высоту %d а не %d" +msgstr "%d адресных пинов, %d rgb пинов и %d тайлов указывают высоту %d а не %d" #: ports/atmel-samd/common-hal/alarm/__init__.c #: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c @@ -92,7 +92,7 @@ msgstr "%d адресные пины, %d rgb пины и %d плитки ука #: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c #: ports/stm/common-hal/rtc/RTC.c msgid "%q" -msgstr "" +msgstr "%q" #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" @@ -100,7 +100,7 @@ msgstr "%q и %q содержат пины-дупликаты" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "%q and %q must be different" -msgstr "" +msgstr "%q и %q должны быть разными" #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" @@ -122,15 +122,15 @@ msgstr "Индекс %q вне диапазона" #: shared-module/bitbangio/SPI.c msgid "%q init failed" -msgstr "" +msgstr "Инициализация %q не удалась" #: shared-bindings/dualbank/__init__.c msgid "%q is %q" -msgstr "" +msgstr "%q является %q" #: py/argcheck.c msgid "%q length must be %d" -msgstr "" +msgstr "Длинна %q должна быть %d" #: py/argcheck.c msgid "%q length must be %d-%d" @@ -138,11 +138,11 @@ msgstr "Длинна %q должна быть %d-%d" #: py/argcheck.c msgid "%q length must be <= %d" -msgstr "" +msgstr "Длинна %q должна быть <= %d" #: py/argcheck.c msgid "%q length must be >= %d" -msgstr "" +msgstr "Длинна %q должна быть >= %d" #: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" @@ -150,44 +150,44 @@ msgstr "Длинна %q должна быть >= 1" #: py/argcheck.c msgid "%q must be %d" -msgstr "" +msgstr "%q должно быть %d" #: py/argcheck.c msgid "%q must be %d-%d" -msgstr "%q должен быть %d-%d" +msgstr "%q должно быть %d-%d" #: shared-bindings/displayio/Display.c msgid "%q must be 1 when %q is True" -msgstr "" +msgstr "%q должно быть 1 когда %q is True" #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" -msgstr "%q должен быть <= %d" +msgstr "%q должно быть <= %d" #: py/argcheck.c msgid "%q must be >= %d" -msgstr "%q должен быть >= %d" +msgstr "%q должно быть >= %d" #: shared-bindings/analogbufio/BufferedIn.c #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" -msgstr "" +msgstr "%q должно быть bytearray или array типа 'h', 'H', 'b', или 'B'" #: py/argcheck.c msgid "%q must be a string" -msgstr "%q должен быть строкой" +msgstr "%q должно быть строкой" #: py/argcheck.c msgid "%q must be an int" -msgstr "" +msgstr "%q должно быть int" #: py/argcheck.c msgid "%q must be of type %q" -msgstr "%q должен быть типа %q" +msgstr "%q должно быть типа %q" #: shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" -msgstr "" +msgstr "%q должно быть типа %q или None" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" @@ -225,7 +225,7 @@ msgstr "%q, %q, и %q должны быть одной длинны" #: py/objint.c shared-bindings/storage/__init__.c msgid "%q=%q" -msgstr "" +msgstr "%q=%q" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format @@ -359,7 +359,7 @@ msgstr "'data' требует как минимум 2 аргумента" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "'data' требует целочисленных аргументов" +msgstr "'data' требует целочисленные аргументы" #: py/compile.c msgid "'label' requires 1 argument" @@ -600,7 +600,7 @@ msgstr "Для управления потоком требуется как RX, #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "Both buttons were pressed at start up.\n" -msgstr "" +msgstr "Обе кнопки были нажаты при загрузке.\n" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -670,7 +670,7 @@ msgstr "Пин шины %d уже используется" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "Button A was pressed at start up.\n" -msgstr "" +msgstr "Кнопка A была нажата при загрузке\n" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -682,7 +682,7 @@ msgstr "Блоки CBC должны быть кратны 16 байтам" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." -msgstr "" +msgstr "Не удалось найти или создать диск CIRCUITPY." #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" @@ -694,7 +694,7 @@ msgstr "Вызовите super().__init__() перед обращением к #: ports/cxd56/common-hal/camera/Camera.c msgid "Camera init" -msgstr "" +msgstr "Иницализация камеры" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." @@ -766,7 +766,7 @@ msgstr "Невозможно перемонтировать '/' пока он в #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present" -msgstr "" +msgstr "Не удалось перезагрузится в загрузчик так как загрузчик отсутствует" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -787,15 +787,18 @@ msgstr "Срез субкласса невозможен" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins" -msgstr "" +msgstr "Невозможно передать данные без пинов MOSI и MISO" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Невозможно изменить частоту на таймере, который уже используется" #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +#, fuzzy msgid "Cannot wake on pin edge, only level" msgstr "" +"Невозможно проснуться по изменению логического уровня (CHANGE), только по " +"уровню (LEVEL)" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." @@ -915,7 +918,7 @@ msgstr "Поворот дисплея должен осуществляться #: main.c msgid "Done" -msgstr "" +msgstr "Выполнено" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." @@ -960,11 +963,12 @@ msgstr "Ожидалось(ся) %q" #: ports/raspberrypi/bindings/cyw43/__init__.c msgid "Expected a %q or %q" -msgstr "" +msgstr "Ожидалось %q или %q" #: shared-bindings/alarm/__init__.c +#, fuzzy msgid "Expected an %q" -msgstr "" +msgstr "Ожидалось %q" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -994,7 +998,7 @@ msgstr "Не удалось получить mutex, ошибка 0x%04x" #: shared-module/rgbmatrix/RGBMatrix.c msgid "Failed to allocate %q buffer" -msgstr "" +msgstr "Не удалось выделить буфер %q" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1045,17 +1049,19 @@ msgid "Filters too complex" msgstr "Фильтры слишком сложные" #: ports/espressif/common-hal/dualbank/__init__.c +#, fuzzy msgid "Firmware is duplicate" -msgstr "" +msgstr "Прошивка является дубликатом" #: ports/espressif/common-hal/dualbank/__init__.c +#, fuzzy msgid "Firmware is invalid" -msgstr "" +msgstr "Прошивка является неправильной" #: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" -msgstr "" +msgstr "Прошивка слишком большая" #: shared-bindings/bitmaptools/__init__.c msgid "For L8 colorspace, input bitmap must have 8 bits per pixel" @@ -1075,6 +1081,8 @@ msgstr "Формат не поддерживается" msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" +"Частота должна быть 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 или 1008 " +"МГц" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1089,7 +1097,7 @@ msgstr "Функция требует блокировки" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "GNSS init" -msgstr "" +msgstr "Инициализация GNSS" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" @@ -1106,7 +1114,7 @@ msgstr "Группа уже используется" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c #: ports/raspberrypi/common-hal/busio/SPI.c msgid "Half duplex SPI is not implemented" -msgstr "" +msgstr "Полудуплексный SPI не реализован" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c @@ -1124,7 +1132,7 @@ msgstr "Операция ввода-вывода на закрытом файл #: ports/stm/common-hal/busio/I2C.c msgid "I2C init error" -msgstr "" +msgstr "Ошибка инициализации I2C" #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c @@ -1240,8 +1248,9 @@ msgid "Internal error #%d" msgstr "Внутренняя ошибка #%d" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "Internal watchdog timer expired." -msgstr "" +msgstr "Внутренний сторожевой таймер истек." #: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c msgid "Invalid %q" @@ -1324,12 +1333,14 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS ключевого слова arg должен быть идентификатором(id)" #: shared-module/displayio/Group.c +#, fuzzy msgid "Layer already in a group" -msgstr "" +msgstr "Слой уже в группе (Group)" #: shared-module/displayio/Group.c +#, fuzzy msgid "Layer must be a Group or TileGrid subclass" -msgstr "" +msgstr "Слой должен быть группой (Group) или субклассом TileGrid." #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" @@ -1351,7 +1362,7 @@ msgstr "Задержка включения микрофона должна бы #: ports/raspberrypi/bindings/rp2pio/StateMachine.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Mismatched data size" -msgstr "" +msgstr "Размер данных различается" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Mismatched swap flag" @@ -1363,7 +1374,7 @@ msgstr "Отсутствует пин MISO или MOSI" #: ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI pin" -msgstr "" +msgstr "Отсутствует пин MISO или MOSI" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1428,7 +1439,7 @@ msgstr "Имя слишком длинное" #: shared-bindings/displayio/TileGrid.c msgid "New bitmap must be same size as old bitmap" -msgstr "" +msgstr "Новый bitmap должен быть того же размера что и старый" #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" @@ -1456,13 +1467,13 @@ msgid "No DMA pacing timer found" msgstr "" #: shared-module/adafruit_bus_device/i2c_device/I2CDevice.c -#, c-format +#, c-format, fuzzy msgid "No I2C device at address: 0x%x" -msgstr "" +msgstr "Не найдено устройство I2C по адресу: %x" #: supervisor/shared/web_workflow/web_workflow.c msgid "No IP" -msgstr "" +msgstr "Нет IP" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1471,7 +1482,7 @@ msgstr "Нет пина MISO" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MISO pin" -msgstr "" +msgstr "Нет пина MISO" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1480,7 +1491,7 @@ msgstr "Нет пина MOSI" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MOSI pin" -msgstr "" +msgstr "Нет пина MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c @@ -1566,8 +1577,9 @@ msgid "No space left on device" msgstr "На устройстве не осталось свободного места" #: py/moduerrno.c +#, fuzzy msgid "No such device" -msgstr "" +msgstr "Нет такого устройства" #: py/moduerrno.c msgid "No such file/directory" @@ -1578,8 +1590,9 @@ msgid "No timer available" msgstr "Нет доступного таймера" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "Nordic system firmware failure assertion." -msgstr "" +msgstr "Сбой системной прошивки Nordic (assertion)." #: ports/nrf/common-hal/_bleio/__init__.c msgid "Nordic system firmware out of memory" @@ -1597,12 +1610,14 @@ msgstr "Не подключено" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c +#, fuzzy msgid "Not playing" -msgstr "Не играет" +msgstr "Не воспроизводится (Not playing)" #: shared-bindings/_bleio/__init__.c +#, fuzzy msgid "Not settable" -msgstr "Не устанавливается" +msgstr "Невозможно установить" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c #, c-format @@ -1622,11 +1637,12 @@ msgstr "" #: supervisor/shared/bluetooth/bluetooth.c msgid "Off" -msgstr "" +msgstr "Выключено" #: supervisor/shared/bluetooth/bluetooth.c +#, fuzzy msgid "Ok" -msgstr "" +msgstr "Ok" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c From eaf0d04a25426bfda7ff684c77d5a01278d1402b Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 29 Nov 2022 16:09:32 +0100 Subject: [PATCH 168/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 13 ++++++++++--- locale/cs.po | 13 ++++++++++--- locale/de_DE.po | 13 ++++++++++--- locale/el.po | 13 ++++++++++--- locale/en_GB.po | 13 ++++++++++--- locale/es.po | 13 ++++++++++--- locale/fil.po | 13 ++++++++++--- locale/fr.po | 13 ++++++++++--- locale/hi.po | 13 ++++++++++--- locale/it_IT.po | 13 ++++++++++--- locale/ja.po | 13 ++++++++++--- locale/ko.po | 13 ++++++++++--- locale/nl.po | 13 ++++++++++--- locale/pl.po | 13 ++++++++++--- locale/pt_BR.po | 13 ++++++++++--- locale/ru.po | 18 +++++++++++++----- locale/sv.po | 13 ++++++++++--- locale/tr.po | 13 ++++++++++--- locale/zh_Latn_pinyin.po | 13 ++++++++++--- 19 files changed, 193 insertions(+), 59 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index fe346373ef..5ac957eb07 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -112,7 +112,7 @@ msgstr "%q gagal: %d" msgid "%q in use" msgstr "%q sedang digunakan" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeks di luar batas" @@ -177,7 +177,7 @@ msgstr "%q harus berupa string" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q harus bertipe %q" @@ -1683,6 +1683,10 @@ msgstr "" msgid "Operation timed out" msgstr "Waktu habis" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Kehabisan memori" @@ -2221,6 +2225,7 @@ msgid "Unable to read color palette data" msgstr "Tidak dapat membaca data palet warna" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3184,7 +3189,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -3436,10 +3441,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 3ea4c2dcf3..55a1787aa7 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -113,7 +113,7 @@ msgstr "%q: selhání %d" msgid "%q in use" msgstr "%q se právě používá" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Index %q je mimo rozsah" @@ -178,7 +178,7 @@ msgstr "%q musí být string" msgid "%q must be an int" msgstr "%q musí být int" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q musí být typu %q" @@ -1679,6 +1679,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2210,6 +2214,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3171,7 +3176,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3423,10 +3428,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index d9c21c5742..127a1c4ac7 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -114,7 +114,7 @@ msgstr "%q Fehler: %d" msgid "%q in use" msgstr "%q in Benutzung" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Der Index %q befindet sich außerhalb des Bereiches" @@ -180,7 +180,7 @@ msgstr "%q muss ein String sein" msgid "%q must be an int" msgstr "%q muss vom Typ Integer sein" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q muss vom Type %q sein" @@ -1700,6 +1700,10 @@ msgstr "Vorgang oder Funktion wird nicht unterstützt" msgid "Operation timed out" msgstr "Zeit für Vorgang abgelaufen" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Kein Speicher mehr verfügbar" @@ -2249,6 +2253,7 @@ msgid "Unable to read color palette data" msgstr "Konnte Farbpalettendaten nicht lesen" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "mDNS-Abfrage kann nicht gestartet werden" @@ -3242,7 +3247,7 @@ msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -3500,10 +3505,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "Loopback + Silent Mode wird vom Peripheriegerät nicht unterstützt" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "mDNS bereits initialisiert" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "mDNS funktioniert nur mit integriertem WiFi" diff --git a/locale/el.po b/locale/el.po index d47a0c5399..4a6b5c4250 100644 --- a/locale/el.po +++ b/locale/el.po @@ -118,7 +118,7 @@ msgstr "%q αποτυχία: %d" msgid "%q in use" msgstr "%q είναι σε χρήση" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q δείκτης εκτός εμβέλειας" @@ -183,7 +183,7 @@ msgstr "%q πρέπει να είναι string" msgid "%q must be an int" msgstr "%q πρέπει να είναι int" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q πρέπει να είναι τύπου %q" @@ -1688,6 +1688,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2219,6 +2223,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3180,7 +3185,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3432,10 +3437,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index e6fabd93d9..15d3644f52 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -116,7 +116,7 @@ msgstr "%q failure: %d" msgid "%q in use" msgstr "%q in use" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q index out of range" @@ -181,7 +181,7 @@ msgstr "%q must be a string" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1683,6 +1683,10 @@ msgstr "Operation or feature not supported" msgid "Operation timed out" msgstr "Operation timed out" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Out of memory" @@ -2223,6 +2227,7 @@ msgid "Unable to read color palette data" msgstr "Unable to read colour palette data" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3190,7 +3195,7 @@ msgid "index is out of bounds" msgstr "index is out of bounds" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index out of range" @@ -3442,10 +3447,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode not supported by peripheral" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/es.po b/locale/es.po index 13cb9a3821..bb1c36b9bf 100644 --- a/locale/es.po +++ b/locale/es.po @@ -118,7 +118,7 @@ msgstr "%q fallo: %d" msgid "%q in use" msgstr "%q está siendo utilizado" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indice fuera de rango" @@ -183,7 +183,7 @@ msgstr "%q debe ser una cadena" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1707,6 +1707,10 @@ msgstr "Operación no característica no soportada" msgid "Operation timed out" msgstr "Tiempo de espera agotado" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Memoria agotada" @@ -2255,6 +2259,7 @@ msgid "Unable to read color palette data" msgstr "No se pudo leer los datos de la paleta de colores" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3230,7 +3235,7 @@ msgid "index is out of bounds" msgstr "el índice está fuera de límites" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index fuera de rango" @@ -3485,10 +3490,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "Loopback + modo silencioso no están soportados por periférico" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index f1e363b149..2cf6e49da4 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -107,7 +107,7 @@ msgstr "" msgid "%q in use" msgstr "%q ay ginagamit" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeks wala sa sakop" @@ -172,7 +172,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1678,6 +1678,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2209,6 +2213,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3184,7 +3189,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index wala sa sakop" @@ -3440,10 +3445,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 2a4d6b230f..9f6bfba96b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -118,7 +118,7 @@ msgstr "Échec de %q : %d" msgid "%q in use" msgstr "%q en cours d'utilisation" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "index %q hors de portée" @@ -183,7 +183,7 @@ msgstr "%q doit être une chaîne de caractères" msgid "%q must be an int" msgstr "%q doit être un entier" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q doit être du type %q" @@ -1727,6 +1727,10 @@ msgstr "Opération ou fonction non supportée" msgid "Operation timed out" msgstr "Timeout de l'opération" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Mémoire insuffisante" @@ -2280,6 +2284,7 @@ msgid "Unable to read color palette data" msgstr "Impossible de lire les données de la palette de couleurs" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "Impossible de lancer la requête mDNS" @@ -3270,7 +3275,7 @@ msgid "index is out of bounds" msgstr "l'index est hors limites" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index est hors bornes" @@ -3529,10 +3534,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode non pris en charge par le périphérique" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "mDNS a déjà été initialisé" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "mDNS ne fonctionne que avec le WiFi intégré" diff --git a/locale/hi.po b/locale/hi.po index 3c3496600b..ec884b211e 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -106,7 +106,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -171,7 +171,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1663,6 +1663,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2192,6 +2196,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3153,7 +3158,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3405,10 +3410,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index e1ba5c3827..60698f4d36 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -113,7 +113,7 @@ msgstr "%q fallito: %d" msgid "%q in use" msgstr "%q in uso" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "indice %q fuori intervallo" @@ -178,7 +178,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1685,6 +1685,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2219,6 +2223,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3192,7 +3197,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -3449,10 +3454,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index f0755961cf..cc48e83b25 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -111,7 +111,7 @@ msgstr "%q 失敗: %d" msgid "%q in use" msgstr "%qは使用中" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q インデックスは範囲外" @@ -176,7 +176,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1676,6 +1676,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2206,6 +2210,7 @@ msgid "Unable to read color palette data" msgstr "カラーパレットデータを読み込めません" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3171,7 +3176,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "インデクスが範囲外" @@ -3424,10 +3429,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 4ec7ff804f..e1609990db 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -107,7 +107,7 @@ msgstr "" msgid "%q in use" msgstr "%q 사용 중입니다" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q 인덱스 범위를 벗어났습니다" @@ -172,7 +172,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1666,6 +1666,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2196,6 +2200,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3157,7 +3162,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3409,10 +3414,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index fc1e1f77b8..e002370151 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -109,7 +109,7 @@ msgstr "%q fout: %d" msgid "%q in use" msgstr "%q in gebruik" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q index buiten bereik" @@ -174,7 +174,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1680,6 +1680,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2216,6 +2220,7 @@ msgid "Unable to read color palette data" msgstr "Niet in staat kleurenpalet data te lezen" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3187,7 +3192,7 @@ msgid "index is out of bounds" msgstr "index is buiten bereik" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index is buiten bereik" @@ -3442,10 +3447,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode wordt niet ondersteund door randapparaat" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 22eacea387..d025272b69 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -111,7 +111,7 @@ msgstr "%q niepowodzenie: %d" msgid "%q in use" msgstr "%q w użyciu" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q poza zakresem" @@ -176,7 +176,7 @@ msgstr "" msgid "%q must be an int" msgstr "" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -1674,6 +1674,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Brak pamięci" @@ -2203,6 +2207,7 @@ msgid "Unable to read color palette data" msgstr "Nie można odczytać danych palety" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3165,7 +3170,7 @@ msgid "index is out of bounds" msgstr "indeks jest poza zakresem" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -3417,10 +3422,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index c3f7475167..e8a71e3d5b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -115,7 +115,7 @@ msgstr "%q falha: %d" msgid "%q in use" msgstr "%q em uso" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "O índice %q está fora do intervalo" @@ -180,7 +180,7 @@ msgstr "%q deve ser uma string" msgid "%q must be an int" msgstr "%q deve ser um inteiro" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q deve ser do tipo %q" @@ -1709,6 +1709,10 @@ msgstr "A operação ou o recurso não é suportado" msgid "Operation timed out" msgstr "A operação expirou" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Sem memória" @@ -2262,6 +2266,7 @@ msgid "Unable to read color palette data" msgstr "Não foi possível ler os dados da paleta de cores" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "Não é possível iniciar a consulta mDNS" @@ -3247,7 +3252,7 @@ msgid "index is out of bounds" msgstr "o índice está fora dos limites" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "Índice fora do intervalo" @@ -3503,10 +3508,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "o loopback + o modo silencioso não é suportado pelo periférico" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "O mDNS já foi inicializado" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "O mDNS só funciona com WiFi integrado" diff --git a/locale/ru.po b/locale/ru.po index 2871aa465e..2bfe2cdece 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -79,7 +79,8 @@ msgstr "%02X" #, c-format msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" -msgstr "%d адресных пинов, %d rgb пинов и %d тайлов указывают высоту %d а не %d" +msgstr "" +"%d адресных пинов, %d rgb пинов и %d тайлов указывают высоту %d а не %d" #: ports/atmel-samd/common-hal/alarm/__init__.c #: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c @@ -116,7 +117,7 @@ msgstr "%q сбой: %d" msgid "%q in use" msgstr "%q используется" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Индекс %q вне диапазона" @@ -181,7 +182,7 @@ msgstr "%q должно быть строкой" msgid "%q must be an int" msgstr "%q должно быть int" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q должно быть типа %q" @@ -1467,7 +1468,7 @@ msgid "No DMA pacing timer found" msgstr "" #: shared-module/adafruit_bus_device/i2c_device/I2CDevice.c -#, c-format, fuzzy +#, fuzzy, c-format msgid "No I2C device at address: 0x%x" msgstr "Не найдено устройство I2C по адресу: %x" @@ -1723,6 +1724,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2259,6 +2264,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3220,7 +3226,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3472,10 +3478,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 1980477f4f..20e22166cd 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -114,7 +114,7 @@ msgstr "%q-fel: %d" msgid "%q in use" msgstr "%q används redan" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Index %q ligger utanför intervallet" @@ -181,7 +181,7 @@ msgstr "%q måste vara en sträng" msgid "%q must be an int" msgstr "%q måste vara en int" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q måste vara av typen %q" @@ -1691,6 +1691,10 @@ msgstr "Operation eller funktion stöds inte" msgid "Operation timed out" msgstr "Åtgärden orsakade timeout" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Slut på minne" @@ -2237,6 +2241,7 @@ msgid "Unable to read color palette data" msgstr "Det går inte att läsa färgpalettdata" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "Det gick inte att starta mDNS-frågan" @@ -3215,7 +3220,7 @@ msgid "index is out of bounds" msgstr "index är utanför gränserna" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index utanför intervallet" @@ -3470,10 +3475,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + tyst läge stöds inte av kringutrustning" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "mDNS har redan initierats" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "mDNS fungerar bara med inbyggt WiFi" diff --git a/locale/tr.po b/locale/tr.po index 1d8eacdae0..09705c507e 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -118,7 +118,7 @@ msgstr "%q hata: %d" msgid "%q in use" msgstr "%q kullanımda" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeksi aralık dışında" @@ -183,7 +183,7 @@ msgstr "%q bir string olmalıdır" msgid "%q must be an int" msgstr "%q bir tam sayı olmalıdır" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q, %q türünde olmalıdır" @@ -1680,6 +1680,10 @@ msgstr "" msgid "Operation timed out" msgstr "" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" @@ -2212,6 +2216,7 @@ msgid "Unable to read color palette data" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "" @@ -3173,7 +3178,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3425,10 +3430,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 408b785287..ac9d28d5fc 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -117,7 +117,7 @@ msgstr "%q Shībài: %d" msgid "%q in use" msgstr "%q zhèngzài bèi shǐyòng" -#: py/obj.c py/objstr.c py/objstrunicode.c +#: py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q suǒyǐn chāochū fànwéi" @@ -183,7 +183,7 @@ msgstr "%q bìxū shì yí gè zì fú chuàn" msgid "%q must be an int" msgstr "%q bìxū shì zhěng xíng" -#: py/argcheck.c +#: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "%q bì xū shì %q lèi xíng" @@ -1698,6 +1698,10 @@ msgstr "bù zhī chí cāo zuò huò gōng néng" msgid "Operation timed out" msgstr "cāo zuò yǐ fēn shí" +#: ports/raspberrypi/common-hal/mdns/Server.c +msgid "Out of MDNS service slots" +msgstr "" + #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "nèi cún bù zú" @@ -2243,6 +2247,7 @@ msgid "Unable to read color palette data" msgstr "Wúfǎ dúqǔ tiáosèbǎn shùjù" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "Unable to start mDNS query" msgstr "wú fǎ qǐ dòng mDNS chá xún" @@ -3222,7 +3227,7 @@ msgid "index is out of bounds" msgstr "suǒyǐn chāochū fànwéi" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" @@ -3475,10 +3480,12 @@ msgid "loopback + silent mode not supported by peripheral" msgstr "Wài shè bù zhī chí huán huí + jìng yīn mó shì" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS already initialized" msgstr "mDNS yǐ chū shǐ huà" #: ports/espressif/common-hal/mdns/Server.c +#: ports/raspberrypi/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" msgstr "mDNS jǐn shì yòng yú nèi zhì wú xiàn wǎng luò" From 8e83f36c36a799d6e3e0cd035c3c803eeb504273 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 29 Nov 2022 13:04:50 -0600 Subject: [PATCH 169/357] SAM E54 Xplained devkit hardfaults at start with -O2 I don't know why, but other samd5x are using -Os too, see the block above. Closes: #7277 --- ports/atmel-samd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 1474ad4c39..68beeaf129 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -79,7 +79,7 @@ endif ifeq ($(CHIP_FAMILY), same54) PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x -OPTIMIZATION_FLAGS ?= -O2 +OPTIMIZATION_FLAGS ?= -Os # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAME5X -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=256 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=256 -DCFG_TUD_MSC_BUFSIZE=1024 endif From 4af95f1cb16fc484a4cb1360dd5f3e6e9c2d888d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 29 Nov 2022 13:45:18 -0600 Subject: [PATCH 170/357] atmel-samd: Ensure sdioio.SDCard pins are released --- ports/atmel-samd/common-hal/sdioio/SDCard.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c index 7ce8a1e1b1..e641db75ac 100644 --- a/ports/atmel-samd/common-hal/sdioio/SDCard.c +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -114,8 +114,6 @@ CLK PA21 PCC_D? (D32) BROWN gpio_set_pin_pull_mode(functions[i]->pin, (i == 1 || i == 5) ? GPIO_PULL_OFF : GPIO_PULL_UP); gpio_set_pin_function(functions[i]->pin, GPIO_PIN_FUNCTION_SDIO); - - common_hal_never_reset_pin(functions[i]->obj); } self->num_data = num_data; @@ -145,6 +143,12 @@ CLK PA21 PCC_D? (D32) BROWN } if (result != SD_MMC_OK) { + for (size_t i = 0; i < MP_ARRAY_SIZE(functions); i++) { + if (!functions[i]->obj) { + break; + } + reset_pin_number(functions[i]->obj->number); + } mp_raise_OSError_msg_varg(translate("%q failure: %d"), MP_QSTR_sd_mmc_check, (int)result); } // sd_mmc_get_capacity() is in KiB, but our "capacity" is in 512-byte blocks From a8c70aa7bd23aab91e3624d1b52b24bd6ed7bd1e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 29 Nov 2022 17:20:38 -0800 Subject: [PATCH 171/357] Fix S3 deep sleep Adding `-u ld_include_highint_hdl` forces the linker to keep the high priority interrupt handler that calls the ipc_isr handler. The deep sleep is waiting for this interrupt to be handled on core 0 before sleeping from core 1. Fixes #6090 --- ports/espressif/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index d515d27b40..4e72e5c45a 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -422,7 +422,7 @@ esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h $(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) $(MBEDTLS_COMPONENTS_LINK_EXPANDED) $(BUILD)/esp-idf/esp-idf/newlib/libnewlib.a -Wl,--end-group -u newlib_include_pthread_impl -Wl,--start-group $(LIBS) -Wl,--end-group $(BUILD)/esp-idf/esp-idf/pthread/libpthread.a -u __cxx_fatal_exception + $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) $(MBEDTLS_COMPONENTS_LINK_EXPANDED) $(BUILD)/esp-idf/esp-idf/newlib/libnewlib.a -Wl,--end-group -u newlib_include_pthread_impl -u ld_include_highint_hdl -Wl,--start-group $(LIBS) -Wl,--end-group $(BUILD)/esp-idf/esp-idf/pthread/libpthread.a -u __cxx_fatal_exception $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf | tools/build_memory_info.py $(STEPECHO) "Create $@" From 3c5fb360a44e607815d768ca7c892edd7d71688f Mon Sep 17 00:00:00 2001 From: m1cha1s Date: Wed, 30 Nov 2022 15:27:14 +0100 Subject: [PATCH 172/357] Removed uncrustify.cfg --- uncrustify.cfg | 3128 ------------------------------------------------ 1 file changed, 3128 deletions(-) delete mode 100644 uncrustify.cfg diff --git a/uncrustify.cfg b/uncrustify.cfg deleted file mode 100644 index 63e22e9391..0000000000 --- a/uncrustify.cfg +++ /dev/null @@ -1,3128 +0,0 @@ -# Uncrustify-0.72.0_f - -# -# General options -# - -# The type of line endings. -# -# Default: auto -newlines = auto # lf/crlf/cr/auto - -# The original size of tabs in the input. -# -# Default: 8 -input_tab_size = 8 # unsigned number - -# The size of tabs in the output (only used if align_with_tabs=true). -# -# Default: 8 -output_tab_size = 8 # unsigned number - -# The ASCII value of the string escape char, usually 92 (\) or (Pawn) 94 (^). -# -# Default: 92 -string_escape_char = 92 # unsigned number - -# Alternate string escape char (usually only used for Pawn). -# Only works right before the quote char. -string_escape_char2 = 0 # unsigned number - -# Replace tab characters found in string literals with the escape sequence \t -# instead. -string_replace_tab_chars = false # true/false - -# Allow interpreting '>=' and '>>=' as part of a template in code like -# 'void f(list>=val);'. If true, 'assert(x<0 && y>=3)' will be broken. -# Improvements to template detection may make this option obsolete. -tok_split_gte = false # true/false - -# Disable formatting of NL_CONT ('\\n') ended lines (e.g. multiline macros) -disable_processing_nl_cont = false # true/false - -# Specify the marker used in comments to disable processing of part of the -# file. -# The comment should be used alone in one line. -# -# Default: *INDENT-OFF* -disable_processing_cmt = " *INDENT-OFF*" # string - -# Specify the marker used in comments to (re)enable processing in a file. -# The comment should be used alone in one line. -# -# Default: *INDENT-ON* -enable_processing_cmt = " *INDENT-ON*" # string - -# Enable parsing of digraphs. -enable_digraphs = false # true/false - -# Add or remove the UTF-8 BOM (recommend 'remove'). -utf8_bom = ignore # ignore/add/remove/force - -# If the file contains bytes with values between 128 and 255, but is not -# UTF-8, then output as UTF-8. -utf8_byte = false # true/false - -# Force the output encoding to UTF-8. -utf8_force = false # true/false - -# Add or remove space between 'do' and '{'. -sp_do_brace_open = ignore # ignore/add/remove/force - -# Add or remove space between '}' and 'while'. -sp_brace_close_while = ignore # ignore/add/remove/force - -# Add or remove space between 'while' and '('. -sp_while_paren_open = ignore # ignore/add/remove/force - -# -# Spacing options -# - -# Add or remove space around non-assignment symbolic operators ('+', '/', '%', -# '<<', and so forth). -sp_arith = ignore # ignore/add/remove/force - -# Add or remove space around arithmetic operators '+' and '-'. -# -# Overrides sp_arith. -sp_arith_additive = ignore # ignore/add/remove/force - -# Add or remove space around assignment operator '=', '+=', etc. -sp_assign = ignore # ignore/add/remove/force - -# Add or remove space around '=' in C++11 lambda capture specifications. -# -# Overrides sp_assign. -sp_cpp_lambda_assign = ignore # ignore/add/remove/force - -# Add or remove space after the capture specification of a C++11 lambda when -# an argument list is present, as in '[] (int x){ ... }'. -sp_cpp_lambda_square_paren = ignore # ignore/add/remove/force - -# Add or remove space after the capture specification of a C++11 lambda with -# no argument list is present, as in '[] { ... }'. -sp_cpp_lambda_square_brace = ignore # ignore/add/remove/force - -# Add or remove space after the argument list of a C++11 lambda, as in -# '[](int x) { ... }'. -sp_cpp_lambda_paren_brace = ignore # ignore/add/remove/force - -# Add or remove space between a lambda body and its call operator of an -# immediately invoked lambda, as in '[]( ... ){ ... } ( ... )'. -sp_cpp_lambda_fparen = ignore # ignore/add/remove/force - -# Add or remove space around assignment operator '=' in a prototype. -# -# If set to ignore, use sp_assign. -sp_assign_default = ignore # ignore/add/remove/force - -# Add or remove space before assignment operator '=', '+=', etc. -# -# Overrides sp_assign. -sp_before_assign = ignore # ignore/add/remove/force - -# Add or remove space after assignment operator '=', '+=', etc. -# -# Overrides sp_assign. -sp_after_assign = ignore # ignore/add/remove/force - -# Add or remove space in 'NS_ENUM ('. -sp_enum_paren = ignore # ignore/add/remove/force - -# Add or remove space around assignment '=' in enum. -sp_enum_assign = ignore # ignore/add/remove/force - -# Add or remove space before assignment '=' in enum. -# -# Overrides sp_enum_assign. -sp_enum_before_assign = ignore # ignore/add/remove/force - -# Add or remove space after assignment '=' in enum. -# -# Overrides sp_enum_assign. -sp_enum_after_assign = ignore # ignore/add/remove/force - -# Add or remove space around assignment ':' in enum. -sp_enum_colon = ignore # ignore/add/remove/force - -# Add or remove space around preprocessor '##' concatenation operator. -# -# Default: add -sp_pp_concat = add # ignore/add/remove/force - -# Add or remove space after preprocessor '#' stringify operator. -# Also affects the '#@' charizing operator. -sp_pp_stringify = ignore # ignore/add/remove/force - -# Add or remove space before preprocessor '#' stringify operator -# as in '#define x(y) L#y'. -sp_before_pp_stringify = ignore # ignore/add/remove/force - -# Add or remove space around boolean operators '&&' and '||'. -sp_bool = ignore # ignore/add/remove/force - -# Add or remove space around compare operator '<', '>', '==', etc. -sp_compare = ignore # ignore/add/remove/force - -# Add or remove space inside '(' and ')'. -sp_inside_paren = ignore # ignore/add/remove/force - -# Add or remove space between nested parentheses, i.e. '((' vs. ') )'. -sp_paren_paren = ignore # ignore/add/remove/force - -# Add or remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. -sp_cparen_oparen = ignore # ignore/add/remove/force - -# Whether to balance spaces inside nested parentheses. -sp_balance_nested_parens = false # true/false - -# Add or remove space between ')' and '{'. -sp_paren_brace = ignore # ignore/add/remove/force - -# Add or remove space between nested braces, i.e. '{{' vs '{ {'. -sp_brace_brace = ignore # ignore/add/remove/force - -# Add or remove space before pointer star '*'. -sp_before_ptr_star = ignore # ignore/add/remove/force - -# Add or remove space before pointer star '*' that isn't followed by a -# variable name. If set to ignore, sp_before_ptr_star is used instead. -sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force - -# Add or remove space between pointer stars '*'. -sp_between_ptr_star = ignore # ignore/add/remove/force - -# Add or remove space after pointer star '*', if followed by a word. -# -# Overrides sp_type_func. -sp_after_ptr_star = ignore # ignore/add/remove/force - -# Add or remove space after pointer caret '^', if followed by a word. -sp_after_ptr_block_caret = ignore # ignore/add/remove/force - -# Add or remove space after pointer star '*', if followed by a qualifier. -sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force - -# Add or remove space after a pointer star '*', if followed by a function -# prototype or function definition. -# -# Overrides sp_after_ptr_star and sp_type_func. -sp_after_ptr_star_func = ignore # ignore/add/remove/force - -# Add or remove space after a pointer star '*', if followed by an open -# parenthesis, as in 'void* (*)(). -sp_ptr_star_paren = ignore # ignore/add/remove/force - -# Add or remove space before a pointer star '*', if followed by a function -# prototype or function definition. -sp_before_ptr_star_func = ignore # ignore/add/remove/force - -# Add or remove space before a reference sign '&'. -sp_before_byref = ignore # ignore/add/remove/force - -# Add or remove space before a reference sign '&' that isn't followed by a -# variable name. If set to ignore, sp_before_byref is used instead. -sp_before_unnamed_byref = ignore # ignore/add/remove/force - -# Add or remove space after reference sign '&', if followed by a word. -# -# Overrides sp_type_func. -sp_after_byref = ignore # ignore/add/remove/force - -# Add or remove space after a reference sign '&', if followed by a function -# prototype or function definition. -# -# Overrides sp_after_byref and sp_type_func. -sp_after_byref_func = ignore # ignore/add/remove/force - -# Add or remove space before a reference sign '&', if followed by a function -# prototype or function definition. -sp_before_byref_func = ignore # ignore/add/remove/force - -# Add or remove space between type and word. In cases where total removal of -# whitespace would be a syntax error, a value of 'remove' is treated the same -# as 'force'. -# -# This also affects some other instances of space following a type that are -# not covered by other options; for example, between the return type and -# parenthesis of a function type template argument, between the type and -# parenthesis of an array parameter, or between 'decltype(...)' and the -# following word. -# -# Default: force -sp_after_type = force # ignore/add/remove/force - -# Add or remove space between 'decltype(...)' and word. -# -# Overrides sp_after_type. -sp_after_decltype = ignore # ignore/add/remove/force - -# (D) Add or remove space before the parenthesis in the D constructs -# 'template Foo(' and 'class Foo('. -sp_before_template_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'template' and '<'. -# If set to ignore, sp_before_angle is used. -sp_template_angle = ignore # ignore/add/remove/force - -# Add or remove space before '<'. -sp_before_angle = ignore # ignore/add/remove/force - -# Add or remove space inside '<' and '>'. -sp_inside_angle = ignore # ignore/add/remove/force - -# Add or remove space inside '<>'. -sp_inside_angle_empty = ignore # ignore/add/remove/force - -# Add or remove space between '>' and ':'. -sp_angle_colon = ignore # ignore/add/remove/force - -# Add or remove space after '>'. -sp_after_angle = ignore # ignore/add/remove/force - -# Add or remove space between '>' and '(' as found in 'new List(foo);'. -sp_angle_paren = ignore # ignore/add/remove/force - -# Add or remove space between '>' and '()' as found in 'new List();'. -sp_angle_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space between '>' and a word as in 'List m;' or -# 'template static ...'. -sp_angle_word = ignore # ignore/add/remove/force - -# Add or remove space between '>' and '>' in '>>' (template stuff). -# -# Default: add -sp_angle_shift = add # ignore/add/remove/force - -# (C++11) Permit removal of the space between '>>' in 'foo >'. Note -# that sp_angle_shift cannot remove the space without this option. -sp_permit_cpp11_shift = false # true/false - -# Add or remove space before '(' of control statements ('if', 'for', 'switch', -# 'while', etc.). -sp_before_sparen = ignore # ignore/add/remove/force - -# Add or remove space inside '(' and ')' of control statements. -sp_inside_sparen = ignore # ignore/add/remove/force - -# Add or remove space after '(' of control statements. -# -# Overrides sp_inside_sparen. -sp_inside_sparen_open = ignore # ignore/add/remove/force - -# Add or remove space before ')' of control statements. -# -# Overrides sp_inside_sparen. -sp_inside_sparen_close = ignore # ignore/add/remove/force - -# Add or remove space after ')' of control statements. -sp_after_sparen = ignore # ignore/add/remove/force - -# Add or remove space between ')' and '{' of of control statements. -sp_sparen_brace = ignore # ignore/add/remove/force - -# (D) Add or remove space between 'invariant' and '('. -sp_invariant_paren = ignore # ignore/add/remove/force - -# (D) Add or remove space after the ')' in 'invariant (C) c'. -sp_after_invariant_paren = ignore # ignore/add/remove/force - -# Add or remove space before empty statement ';' on 'if', 'for' and 'while'. -sp_special_semi = ignore # ignore/add/remove/force - -# Add or remove space before ';'. -# -# Default: remove -sp_before_semi = remove # ignore/add/remove/force - -# Add or remove space before ';' in non-empty 'for' statements. -sp_before_semi_for = ignore # ignore/add/remove/force - -# Add or remove space before a semicolon of an empty part of a for statement. -sp_before_semi_for_empty = ignore # ignore/add/remove/force - -# Add or remove space after ';', except when followed by a comment. -# -# Default: add -sp_after_semi = add # ignore/add/remove/force - -# Add or remove space after ';' in non-empty 'for' statements. -# -# Default: force -sp_after_semi_for = force # ignore/add/remove/force - -# Add or remove space after the final semicolon of an empty part of a for -# statement, as in 'for ( ; ; )'. -sp_after_semi_for_empty = ignore # ignore/add/remove/force - -# Add or remove space before '[' (except '[]'). -sp_before_square = ignore # ignore/add/remove/force - -# Add or remove space before '[' for a variable definition. -# -# Default: remove -sp_before_vardef_square = remove # ignore/add/remove/force - -# Add or remove space before '[' for asm block. -sp_before_square_asm_block = ignore # ignore/add/remove/force - -# Add or remove space before '[]'. -sp_before_squares = ignore # ignore/add/remove/force - -# Add or remove space before C++17 structured bindings. -sp_cpp_before_struct_binding = ignore # ignore/add/remove/force - -# Add or remove space inside a non-empty '[' and ']'. -sp_inside_square = ignore # ignore/add/remove/force - -# Add or remove space inside '[]'. -sp_inside_square_empty = ignore # ignore/add/remove/force - -# (OC) Add or remove space inside a non-empty Objective-C boxed array '@[' and -# ']'. If set to ignore, sp_inside_square is used. -sp_inside_square_oc_array = ignore # ignore/add/remove/force - -# Add or remove space after ',', i.e. 'a,b' vs. 'a, b'. -sp_after_comma = ignore # ignore/add/remove/force - -# Add or remove space before ','. -# -# Default: remove -sp_before_comma = remove # ignore/add/remove/force - -# (C#) Add or remove space between ',' and ']' in multidimensional array type -# like 'int[,,]'. -sp_after_mdatype_commas = ignore # ignore/add/remove/force - -# (C#) Add or remove space between '[' and ',' in multidimensional array type -# like 'int[,,]'. -sp_before_mdatype_commas = ignore # ignore/add/remove/force - -# (C#) Add or remove space between ',' in multidimensional array type -# like 'int[,,]'. -sp_between_mdatype_commas = ignore # ignore/add/remove/force - -# Add or remove space between an open parenthesis and comma, -# i.e. '(,' vs. '( ,'. -# -# Default: force -sp_paren_comma = force # ignore/add/remove/force - -# Add or remove space before the variadic '...' when preceded by a -# non-punctuator. -sp_before_ellipsis = ignore # ignore/add/remove/force - -# Add or remove space between a type and '...'. -sp_type_ellipsis = ignore # ignore/add/remove/force - -# (D) Add or remove space between a type and '?'. -sp_type_question = ignore # ignore/add/remove/force - -# Add or remove space between ')' and '...'. -sp_paren_ellipsis = ignore # ignore/add/remove/force - -# Add or remove space between ')' and a qualifier such as 'const'. -sp_paren_qualifier = ignore # ignore/add/remove/force - -# Add or remove space between ')' and 'noexcept'. -sp_paren_noexcept = ignore # ignore/add/remove/force - -# Add or remove space after class ':'. -sp_after_class_colon = ignore # ignore/add/remove/force - -# Add or remove space before class ':'. -sp_before_class_colon = ignore # ignore/add/remove/force - -# Add or remove space after class constructor ':'. -sp_after_constr_colon = ignore # ignore/add/remove/force - -# Add or remove space before class constructor ':'. -sp_before_constr_colon = ignore # ignore/add/remove/force - -# Add or remove space before case ':'. -# -# Default: remove -sp_before_case_colon = remove # ignore/add/remove/force - -# Add or remove space between 'operator' and operator sign. -sp_after_operator = ignore # ignore/add/remove/force - -# Add or remove space between the operator symbol and the open parenthesis, as -# in 'operator ++('. -sp_after_operator_sym = ignore # ignore/add/remove/force - -# Overrides sp_after_operator_sym when the operator has no arguments, as in -# 'operator *()'. -sp_after_operator_sym_empty = ignore # ignore/add/remove/force - -# Add or remove space after C/D cast, i.e. 'cast(int)a' vs. 'cast(int) a' or -# '(int)a' vs. '(int) a'. -sp_after_cast = ignore # ignore/add/remove/force - -# Add or remove spaces inside cast parentheses. -sp_inside_paren_cast = ignore # ignore/add/remove/force - -# Add or remove space between the type and open parenthesis in a C++ cast, -# i.e. 'int(exp)' vs. 'int (exp)'. -sp_cpp_cast_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'sizeof' and '('. -sp_sizeof_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'sizeof' and '...'. -sp_sizeof_ellipsis = ignore # ignore/add/remove/force - -# Add or remove space between 'sizeof...' and '('. -sp_sizeof_ellipsis_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'decltype' and '('. -sp_decltype_paren = ignore # ignore/add/remove/force - -# (Pawn) Add or remove space after the tag keyword. -sp_after_tag = ignore # ignore/add/remove/force - -# Add or remove space inside enum '{' and '}'. -sp_inside_braces_enum = ignore # ignore/add/remove/force - -# Add or remove space inside struct/union '{' and '}'. -sp_inside_braces_struct = ignore # ignore/add/remove/force - -# (OC) Add or remove space inside Objective-C boxed dictionary '{' and '}' -sp_inside_braces_oc_dict = ignore # ignore/add/remove/force - -# Add or remove space after open brace in an unnamed temporary -# direct-list-initialization. -sp_after_type_brace_init_lst_open = ignore # ignore/add/remove/force - -# Add or remove space before close brace in an unnamed temporary -# direct-list-initialization. -sp_before_type_brace_init_lst_close = ignore # ignore/add/remove/force - -# Add or remove space inside an unnamed temporary direct-list-initialization. -sp_inside_type_brace_init_lst = ignore # ignore/add/remove/force - -# Add or remove space inside '{' and '}'. -sp_inside_braces = ignore # ignore/add/remove/force - -# Add or remove space inside '{}'. -sp_inside_braces_empty = ignore # ignore/add/remove/force - -# Add or remove space around trailing return operator '->'. -sp_trailing_return = ignore # ignore/add/remove/force - -# Add or remove space between return type and function name. A minimum of 1 -# is forced except for pointer return types. -sp_type_func = ignore # ignore/add/remove/force - -# Add or remove space between type and open brace of an unnamed temporary -# direct-list-initialization. -sp_type_brace_init_lst = ignore # ignore/add/remove/force - -# Add or remove space between function name and '(' on function declaration. -sp_func_proto_paren = ignore # ignore/add/remove/force - -# Add or remove space between function name and '()' on function declaration -# without parameters. -sp_func_proto_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space between function name and '(' with a typedef specifier. -sp_func_type_paren = ignore # ignore/add/remove/force - -# Add or remove space between alias name and '(' of a non-pointer function type typedef. -sp_func_def_paren = ignore # ignore/add/remove/force - -# Add or remove space between function name and '()' on function definition -# without parameters. -sp_func_def_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space inside empty function '()'. -# Overrides sp_after_angle unless use_sp_after_angle_always is set to true. -sp_inside_fparens = ignore # ignore/add/remove/force - -# Add or remove space inside function '(' and ')'. -sp_inside_fparen = ignore # ignore/add/remove/force - -# Add or remove space inside the first parentheses in a function type, as in -# 'void (*x)(...)'. -sp_inside_tparen = ignore # ignore/add/remove/force - -# Add or remove space between the ')' and '(' in a function type, as in -# 'void (*x)(...)'. -sp_after_tparen_close = ignore # ignore/add/remove/force - -# Add or remove space between ']' and '(' when part of a function call. -sp_square_fparen = ignore # ignore/add/remove/force - -# Add or remove space between ')' and '{' of function. -sp_fparen_brace = ignore # ignore/add/remove/force - -# Add or remove space between ')' and '{' of a function call in object -# initialization. -# -# Overrides sp_fparen_brace. -sp_fparen_brace_initializer = ignore # ignore/add/remove/force - -# (Java) Add or remove space between ')' and '{{' of double brace initializer. -sp_fparen_dbrace = ignore # ignore/add/remove/force - -# Add or remove space between function name and '(' on function calls. -sp_func_call_paren = ignore # ignore/add/remove/force - -# Add or remove space between function name and '()' on function calls without -# parameters. If set to ignore (the default), sp_func_call_paren is used. -sp_func_call_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space between the user function name and '(' on function -# calls. You need to set a keyword to be a user function in the config file, -# like: -# set func_call_user tr _ i18n -sp_func_call_user_paren = ignore # ignore/add/remove/force - -# Add or remove space inside user function '(' and ')'. -sp_func_call_user_inside_fparen = ignore # ignore/add/remove/force - -# Add or remove space between nested parentheses with user functions, -# i.e. '((' vs. '( ('. -sp_func_call_user_paren_paren = ignore # ignore/add/remove/force - -# Add or remove space between a constructor/destructor and the open -# parenthesis. -sp_func_class_paren = ignore # ignore/add/remove/force - -# Add or remove space between a constructor without parameters or destructor -# and '()'. -sp_func_class_paren_empty = ignore # ignore/add/remove/force - -# Add or remove space between 'return' and '('. -sp_return_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'return' and '{'. -sp_return_brace = ignore # ignore/add/remove/force - -# Add or remove space between '__attribute__' and '('. -sp_attribute_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'defined' and '(' in '#if defined (FOO)'. -sp_defined_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'throw' and '(' in 'throw (something)'. -sp_throw_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'throw' and anything other than '(' as in -# '@throw [...];'. -sp_after_throw = ignore # ignore/add/remove/force - -# Add or remove space between 'catch' and '(' in 'catch (something) { }'. -# If set to ignore, sp_before_sparen is used. -sp_catch_paren = ignore # ignore/add/remove/force - -# (OC) Add or remove space between '@catch' and '(' -# in '@catch (something) { }'. If set to ignore, sp_catch_paren is used. -sp_oc_catch_paren = ignore # ignore/add/remove/force - -# (OC) Add or remove space before Objective-C protocol list -# as in '@protocol Protocol' or '@interface MyClass : NSObject'. -sp_before_oc_proto_list = ignore # ignore/add/remove/force - -# (OC) Add or remove space between class name and '(' -# in '@interface className(categoryName):BaseClass' -sp_oc_classname_paren = ignore # ignore/add/remove/force - -# (D) Add or remove space between 'version' and '(' -# in 'version (something) { }'. If set to ignore, sp_before_sparen is used. -sp_version_paren = ignore # ignore/add/remove/force - -# (D) Add or remove space between 'scope' and '(' -# in 'scope (something) { }'. If set to ignore, sp_before_sparen is used. -sp_scope_paren = ignore # ignore/add/remove/force - -# Add or remove space between 'super' and '(' in 'super (something)'. -# -# Default: remove -sp_super_paren = remove # ignore/add/remove/force - -# Add or remove space between 'this' and '(' in 'this (something)'. -# -# Default: remove -sp_this_paren = remove # ignore/add/remove/force - -# Add or remove space between a macro name and its definition. -sp_macro = ignore # ignore/add/remove/force - -# Add or remove space between a macro function ')' and its definition. -sp_macro_func = ignore # ignore/add/remove/force - -# Add or remove space between 'else' and '{' if on the same line. -sp_else_brace = ignore # ignore/add/remove/force - -# Add or remove space between '}' and 'else' if on the same line. -sp_brace_else = ignore # ignore/add/remove/force - -# Add or remove space between '}' and the name of a typedef on the same line. -sp_brace_typedef = ignore # ignore/add/remove/force - -# Add or remove space before the '{' of a 'catch' statement, if the '{' and -# 'catch' are on the same line, as in 'catch (decl) {'. -sp_catch_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove space before the '{' of a '@catch' statement, if the '{' -# and '@catch' are on the same line, as in '@catch (decl) {'. -# If set to ignore, sp_catch_brace is used. -sp_oc_catch_brace = ignore # ignore/add/remove/force - -# Add or remove space between '}' and 'catch' if on the same line. -sp_brace_catch = ignore # ignore/add/remove/force - -# (OC) Add or remove space between '}' and '@catch' if on the same line. -# If set to ignore, sp_brace_catch is used. -sp_oc_brace_catch = ignore # ignore/add/remove/force - -# Add or remove space between 'finally' and '{' if on the same line. -sp_finally_brace = ignore # ignore/add/remove/force - -# Add or remove space between '}' and 'finally' if on the same line. -sp_brace_finally = ignore # ignore/add/remove/force - -# Add or remove space between 'try' and '{' if on the same line. -sp_try_brace = ignore # ignore/add/remove/force - -# Add or remove space between get/set and '{' if on the same line. -sp_getset_brace = ignore # ignore/add/remove/force - -# Add or remove space between a variable and '{' for C++ uniform -# initialization. -sp_word_brace_init_lst = ignore # ignore/add/remove/force - -# Add or remove space between a variable and '{' for a namespace. -# -# Default: add -sp_word_brace_ns = add # ignore/add/remove/force - -# Add or remove space before the '::' operator. -sp_before_dc = ignore # ignore/add/remove/force - -# Add or remove space after the '::' operator. -sp_after_dc = ignore # ignore/add/remove/force - -# (D) Add or remove around the D named array initializer ':' operator. -sp_d_array_colon = ignore # ignore/add/remove/force - -# Add or remove space after the '!' (not) unary operator. -# -# Default: remove -sp_not = remove # ignore/add/remove/force - -# Add or remove space after the '~' (invert) unary operator. -# -# Default: remove -sp_inv = remove # ignore/add/remove/force - -# Add or remove space after the '&' (address-of) unary operator. This does not -# affect the spacing after a '&' that is part of a type. -# -# Default: remove -sp_addr = remove # ignore/add/remove/force - -# Add or remove space around the '.' or '->' operators. -# -# Default: remove -sp_member = remove # ignore/add/remove/force - -# Add or remove space after the '*' (dereference) unary operator. This does -# not affect the spacing after a '*' that is part of a type. -# -# Default: remove -sp_deref = remove # ignore/add/remove/force - -# Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. -# -# Default: remove -sp_sign = remove # ignore/add/remove/force - -# Add or remove space between '++' and '--' the word to which it is being -# applied, as in '(--x)' or 'y++;'. -# -# Default: remove -sp_incdec = remove # ignore/add/remove/force - -# Add or remove space before a backslash-newline at the end of a line. -# -# Default: add -sp_before_nl_cont = add # ignore/add/remove/force - -# (OC) Add or remove space after the scope '+' or '-', as in '-(void) foo;' -# or '+(int) bar;'. -sp_after_oc_scope = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the colon in message specs, -# i.e. '-(int) f:(int) x;' vs. '-(int) f: (int) x;'. -sp_after_oc_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space before the colon in message specs, -# i.e. '-(int) f: (int) x;' vs. '-(int) f : (int) x;'. -sp_before_oc_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the colon in immutable dictionary expression -# 'NSDictionary *test = @{@"foo" :@"bar"};'. -sp_after_oc_dict_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space before the colon in immutable dictionary expression -# 'NSDictionary *test = @{@"foo" :@"bar"};'. -sp_before_oc_dict_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the colon in message specs, -# i.e. '[object setValue:1];' vs. '[object setValue: 1];'. -sp_after_send_oc_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space before the colon in message specs, -# i.e. '[object setValue:1];' vs. '[object setValue :1];'. -sp_before_send_oc_colon = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the (type) in message specs, -# i.e. '-(int)f: (int) x;' vs. '-(int)f: (int)x;'. -sp_after_oc_type = ignore # ignore/add/remove/force - -# (OC) Add or remove space after the first (type) in message specs, -# i.e. '-(int) f:(int)x;' vs. '-(int)f:(int)x;'. -sp_after_oc_return_type = ignore # ignore/add/remove/force - -# (OC) Add or remove space between '@selector' and '(', -# i.e. '@selector(msgName)' vs. '@selector (msgName)'. -# Also applies to '@protocol()' constructs. -sp_after_oc_at_sel = ignore # ignore/add/remove/force - -# (OC) Add or remove space between '@selector(x)' and the following word, -# i.e. '@selector(foo) a:' vs. '@selector(foo)a:'. -sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force - -# (OC) Add or remove space inside '@selector' parentheses, -# i.e. '@selector(foo)' vs. '@selector( foo )'. -# Also applies to '@protocol()' constructs. -sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force - -# (OC) Add or remove space before a block pointer caret, -# i.e. '^int (int arg){...}' vs. ' ^int (int arg){...}'. -sp_before_oc_block_caret = ignore # ignore/add/remove/force - -# (OC) Add or remove space after a block pointer caret, -# i.e. '^int (int arg){...}' vs. '^ int (int arg){...}'. -sp_after_oc_block_caret = ignore # ignore/add/remove/force - -# (OC) Add or remove space between the receiver and selector in a message, -# as in '[receiver selector ...]'. -sp_after_oc_msg_receiver = ignore # ignore/add/remove/force - -# (OC) Add or remove space after '@property'. -sp_after_oc_property = ignore # ignore/add/remove/force - -# (OC) Add or remove space between '@synchronized' and the open parenthesis, -# i.e. '@synchronized(foo)' vs. '@synchronized (foo)'. -sp_after_oc_synchronized = ignore # ignore/add/remove/force - -# Add or remove space around the ':' in 'b ? t : f'. -sp_cond_colon = ignore # ignore/add/remove/force - -# Add or remove space before the ':' in 'b ? t : f'. -# -# Overrides sp_cond_colon. -sp_cond_colon_before = ignore # ignore/add/remove/force - -# Add or remove space after the ':' in 'b ? t : f'. -# -# Overrides sp_cond_colon. -sp_cond_colon_after = ignore # ignore/add/remove/force - -# Add or remove space around the '?' in 'b ? t : f'. -sp_cond_question = ignore # ignore/add/remove/force - -# Add or remove space before the '?' in 'b ? t : f'. -# -# Overrides sp_cond_question. -sp_cond_question_before = ignore # ignore/add/remove/force - -# Add or remove space after the '?' in 'b ? t : f'. -# -# Overrides sp_cond_question. -sp_cond_question_after = ignore # ignore/add/remove/force - -# In the abbreviated ternary form '(a ?: b)', add or remove space between '?' -# and ':'. -# -# Overrides all other sp_cond_* options. -sp_cond_ternary_short = ignore # ignore/add/remove/force - -# Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make -# sense here. -sp_case_label = ignore # ignore/add/remove/force - -# (D) Add or remove space around the D '..' operator. -sp_range = ignore # ignore/add/remove/force - -# Add or remove space after ':' in a Java/C++11 range-based 'for', -# as in 'for (Type var : expr)'. -sp_after_for_colon = ignore # ignore/add/remove/force - -# Add or remove space before ':' in a Java/C++11 range-based 'for', -# as in 'for (Type var : expr)'. -sp_before_for_colon = ignore # ignore/add/remove/force - -# (D) Add or remove space between 'extern' and '(' as in 'extern (C)'. -sp_extern_paren = ignore # ignore/add/remove/force - -# Add or remove space after the opening of a C++ comment, -# i.e. '// A' vs. '//A'. -sp_cmt_cpp_start = ignore # ignore/add/remove/force - -# If true, space is added with sp_cmt_cpp_start will be added after doxygen -# sequences like '///', '///<', '//!' and '//!<'. -sp_cmt_cpp_doxygen = false # true/false - -# If true, space is added with sp_cmt_cpp_start will be added after Qt -# translator or meta-data comments like '//:', '//=', and '//~'. -sp_cmt_cpp_qttr = false # true/false - -# Add or remove space between #else or #endif and a trailing comment. -sp_endif_cmt = ignore # ignore/add/remove/force - -# Add or remove space after 'new', 'delete' and 'delete[]'. -sp_after_new = ignore # ignore/add/remove/force - -# Add or remove space between 'new' and '(' in 'new()'. -sp_between_new_paren = ignore # ignore/add/remove/force - -# Add or remove space between ')' and type in 'new(foo) BAR'. -sp_after_newop_paren = ignore # ignore/add/remove/force - -# Add or remove space inside parenthesis of the new operator -# as in 'new(foo) BAR'. -sp_inside_newop_paren = ignore # ignore/add/remove/force - -# Add or remove space after the open parenthesis of the new operator, -# as in 'new(foo) BAR'. -# -# Overrides sp_inside_newop_paren. -sp_inside_newop_paren_open = ignore # ignore/add/remove/force - -# Add or remove space before the close parenthesis of the new operator, -# as in 'new(foo) BAR'. -# -# Overrides sp_inside_newop_paren. -sp_inside_newop_paren_close = ignore # ignore/add/remove/force - -# Add or remove space before a trailing or embedded comment. -sp_before_tr_emb_cmt = ignore # ignore/add/remove/force - -# Number of spaces before a trailing or embedded comment. -sp_num_before_tr_emb_cmt = 0 # unsigned number - -# (Java) Add or remove space between an annotation and the open parenthesis. -sp_annotation_paren = ignore # ignore/add/remove/force - -# If true, vbrace tokens are dropped to the previous token and skipped. -sp_skip_vbrace_tokens = false # true/false - -# Add or remove space after 'noexcept'. -sp_after_noexcept = ignore # ignore/add/remove/force - -# Add or remove space after '_'. -sp_vala_after_translation = ignore # ignore/add/remove/force - -# If true, a is inserted after #define. -force_tab_after_define = false # true/false - -# -# Indenting options -# - -# The number of columns to indent per level. Usually 2, 3, 4, or 8. -# -# Default: 8 -indent_columns = 8 # unsigned number - -# The continuation indent. If non-zero, this overrides the indent of '(', '[' -# and '=' continuation indents. Negative values are OK; negative value is -# absolute and not increased for each '(' or '[' level. -# -# For FreeBSD, this is set to 4. -indent_continue = 0 # number - -# The continuation indent, only for class header line(s). If non-zero, this -# overrides the indent of 'class' continuation indents. -indent_continue_class_head = 0 # unsigned number - -# Whether to indent empty lines (i.e. lines which contain only spaces before -# the newline character). -indent_single_newlines = false # true/false - -# The continuation indent for func_*_param if they are true. If non-zero, this -# overrides the indent. -indent_param = 0 # unsigned number - -# How to use tabs when indenting code. -# -# 0: Spaces only -# 1: Indent with tabs to brace level, align with spaces (default) -# 2: Indent and align with tabs, using spaces when not on a tabstop -# -# Default: 1 -indent_with_tabs = 1 # unsigned number - -# Whether to indent comments that are not at a brace level with tabs on a -# tabstop. Requires indent_with_tabs=2. If false, will use spaces. -indent_cmt_with_tabs = false # true/false - -# Whether to indent strings broken by '\' so that they line up. -indent_align_string = false # true/false - -# The number of spaces to indent multi-line XML strings. -# Requires indent_align_string=true. -indent_xml_string = 0 # unsigned number - -# Spaces to indent '{' from level. -indent_brace = 0 # unsigned number - -# Whether braces are indented to the body level. -indent_braces = false # true/false - -# Whether to disable indenting function braces if indent_braces=true. -indent_braces_no_func = false # true/false - -# Whether to disable indenting class braces if indent_braces=true. -indent_braces_no_class = false # true/false - -# Whether to disable indenting struct braces if indent_braces=true. -indent_braces_no_struct = false # true/false - -# Whether to indent based on the size of the brace parent, -# i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. -indent_brace_parent = false # true/false - -# Whether to indent based on the open parenthesis instead of the open brace -# in '({\n'. -indent_paren_open_brace = false # true/false - -# (C#) Whether to indent the brace of a C# delegate by another level. -indent_cs_delegate_brace = false # true/false - -# (C#) Whether to indent a C# delegate (to handle delegates with no brace) by -# another level. -indent_cs_delegate_body = false # true/false - -# Whether to indent the body of a 'namespace'. -indent_namespace = false # true/false - -# Whether to indent only the first namespace, and not any nested namespaces. -# Requires indent_namespace=true. -indent_namespace_single_indent = false # true/false - -# The number of spaces to indent a namespace block. -# If set to zero, use the value indent_columns -indent_namespace_level = 0 # unsigned number - -# If the body of the namespace is longer than this number, it won't be -# indented. Requires indent_namespace=true. 0 means no limit. -indent_namespace_limit = 0 # unsigned number - -# Whether the 'extern "C"' body is indented. -indent_extern = false # true/false - -# Whether the 'class' body is indented. -indent_class = false # true/false - -# Whether to indent the stuff after a leading base class colon. -indent_class_colon = false # true/false - -# Whether to indent based on a class colon instead of the stuff after the -# colon. Requires indent_class_colon=true. -indent_class_on_colon = false # true/false - -# Whether to indent the stuff after a leading class initializer colon. -indent_constr_colon = false # true/false - -# Virtual indent from the ':' for member initializers. -# -# Default: 2 -indent_ctor_init_leading = 2 # unsigned number - -# Additional indent for constructor initializer list. -# Negative values decrease indent down to the first column. -indent_ctor_init = 0 # number - -# Whether to indent 'if' following 'else' as a new block under the 'else'. -# If false, 'else\nif' is treated as 'else if' for indenting purposes. -indent_else_if = false # true/false - -# Amount to indent variable declarations after a open brace. -# -# <0: Relative -# >=0: Absolute -indent_var_def_blk = 0 # number - -# Whether to indent continued variable declarations instead of aligning. -indent_var_def_cont = false # true/false - -# Whether to indent continued shift expressions ('<<' and '>>') instead of -# aligning. Set align_left_shift=false when enabling this. -indent_shift = false # true/false - -# Whether to force indentation of function definitions to start in column 1. -indent_func_def_force_col1 = false # true/false - -# Whether to indent continued function call parameters one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_call_param = false # true/false - -# Whether to indent continued function definition parameters one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_def_param = false # true/false - -# for function definitions, only if indent_func_def_param is false -# Allows to align params when appropriate and indent them when not -# behave as if it was true if paren position is more than this value -# if paren position is more than the option value -indent_func_def_param_paren_pos_threshold = 0 # unsigned number - -# Whether to indent continued function call prototype one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_proto_param = false # true/false - -# Whether to indent continued function call declaration one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_class_param = false # true/false - -# Whether to indent continued class variable constructors one indent level, -# rather than aligning parameters under the open parenthesis. -indent_func_ctor_var_param = false # true/false - -# Whether to indent continued template parameter list one indent level, -# rather than aligning parameters under the open parenthesis. -indent_template_param = false # true/false - -# Double the indent for indent_func_xxx_param options. -# Use both values of the options indent_columns and indent_param. -indent_func_param_double = false # true/false - -# Indentation column for standalone 'const' qualifier on a function -# prototype. -indent_func_const = 0 # unsigned number - -# Indentation column for standalone 'throw' qualifier on a function -# prototype. -indent_func_throw = 0 # unsigned number - -# How to indent within a macro followed by a brace on the same line -# This allows reducing the indent in macros that have (for example) -# `do { ... } while (0)` blocks bracketing them. -# -# true: add an indent for the brace on the same line as the macro -# false: do not add an indent for the brace on the same line as the macro -# -# Default: true -indent_macro_brace = true # true/false - -# The number of spaces to indent a continued '->' or '.'. -# Usually set to 0, 1, or indent_columns. -indent_member = 0 # unsigned number - -# Whether lines broken at '.' or '->' should be indented by a single indent. -# The indent_member option will not be effective if this is set to true. -indent_member_single = false # true/false - -# Spaces to indent single line ('//') comments on lines before code. -indent_sing_line_comments = 0 # unsigned number - -# When opening a paren for a control statement (if, for, while, etc), increase -# the indent level by this value. Negative values decrease the indent level. -indent_sparen_extra = 0 # number - -# Whether to indent trailing single line ('//') comments relative to the code -# instead of trying to keep the same absolute column. -indent_relative_single_line_comments = false # true/false - -# Spaces to indent 'case' from 'switch'. Usually 0 or indent_columns. -indent_switch_case = 0 # unsigned number - -# indent 'break' with 'case' from 'switch'. -indent_switch_break_with_case = false # true/false - -# Whether to indent preprocessor statements inside of switch statements. -# -# Default: true -indent_switch_pp = true # true/false - -# Spaces to shift the 'case' line, without affecting any other lines. -# Usually 0. -indent_case_shift = 0 # unsigned number - -# Spaces to indent '{' from 'case'. By default, the brace will appear under -# the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK. -indent_case_brace = 0 # number - -# Whether to indent comments found in first column. -indent_col1_comment = false # true/false - -# Whether to indent multi string literal in first column. -indent_col1_multi_string_literal = false # true/false - -# How to indent goto labels. -# -# >0: Absolute column where 1 is the leftmost column -# <=0: Subtract from brace indent -# -# Default: 1 -indent_label = 1 # number - -# How to indent access specifiers that are followed by a -# colon. -# -# >0: Absolute column where 1 is the leftmost column -# <=0: Subtract from brace indent -# -# Default: 1 -indent_access_spec = 1 # number - -# Whether to indent the code after an access specifier by one level. -# If true, this option forces 'indent_access_spec=0'. -indent_access_spec_body = false # true/false - -# If an open parenthesis is followed by a newline, whether to indent the next -# line so that it lines up after the open parenthesis (not recommended). -indent_paren_nl = false # true/false - -# How to indent a close parenthesis after a newline. -# -# 0: Indent to body level (default) -# 1: Align under the open parenthesis -# 2: Indent to the brace level -indent_paren_close = 0 # unsigned number - -# Whether to indent the open parenthesis of a function definition, -# if the parenthesis is on its own line. -indent_paren_after_func_def = false # true/false - -# Whether to indent the open parenthesis of a function declaration, -# if the parenthesis is on its own line. -indent_paren_after_func_decl = false # true/false - -# Whether to indent the open parenthesis of a function call, -# if the parenthesis is on its own line. -indent_paren_after_func_call = false # true/false - -# Whether to indent a comma when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_comma_paren = false # true/false - -# Whether to indent a Boolean operator when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_bool_paren = false # true/false - -# Whether to indent a semicolon when inside a for parenthesis. -# If true, aligns under the open for parenthesis. -indent_semicolon_for_paren = false # true/false - -# Whether to align the first expression to following ones -# if indent_bool_paren=true. -indent_first_bool_expr = false # true/false - -# Whether to align the first expression to following ones -# if indent_semicolon_for_paren=true. -indent_first_for_expr = false # true/false - -# If an open square is followed by a newline, whether to indent the next line -# so that it lines up after the open square (not recommended). -indent_square_nl = false # true/false - -# (ESQL/C) Whether to preserve the relative indent of 'EXEC SQL' bodies. -indent_preserve_sql = false # true/false - -# Whether to align continued statements at the '='. If false or if the '=' is -# followed by a newline, the next line is indent one tab. -# -# Default: true -indent_align_assign = true # true/false - -# If true, the indentation of the chunks after a '=' sequence will be set at -# LHS token indentation column before '='. -indent_off_after_assign = false # true/false - -# Whether to align continued statements at the '('. If false or the '(' is -# followed by a newline, the next line indent is one tab. -# -# Default: true -indent_align_paren = true # true/false - -# (OC) Whether to indent Objective-C code inside message selectors. -indent_oc_inside_msg_sel = false # true/false - -# (OC) Whether to indent Objective-C blocks at brace level instead of usual -# rules. -indent_oc_block = false # true/false - -# (OC) Indent for Objective-C blocks in a message relative to the parameter -# name. -# -# =0: Use indent_oc_block rules -# >0: Use specified number of spaces to indent -indent_oc_block_msg = 0 # unsigned number - -# (OC) Minimum indent for subsequent parameters -indent_oc_msg_colon = 0 # unsigned number - -# (OC) Whether to prioritize aligning with initial colon (and stripping spaces -# from lines, if necessary). -# -# Default: true -indent_oc_msg_prioritize_first_colon = true # true/false - -# (OC) Whether to indent blocks the way that Xcode does by default -# (from the keyword if the parameter is on its own line; otherwise, from the -# previous indentation level). Requires indent_oc_block_msg=true. -indent_oc_block_msg_xcode_style = false # true/false - -# (OC) Whether to indent blocks from where the brace is, relative to a -# message keyword. Requires indent_oc_block_msg=true. -indent_oc_block_msg_from_keyword = false # true/false - -# (OC) Whether to indent blocks from where the brace is, relative to a message -# colon. Requires indent_oc_block_msg=true. -indent_oc_block_msg_from_colon = false # true/false - -# (OC) Whether to indent blocks from where the block caret is. -# Requires indent_oc_block_msg=true. -indent_oc_block_msg_from_caret = false # true/false - -# (OC) Whether to indent blocks from where the brace caret is. -# Requires indent_oc_block_msg=true. -indent_oc_block_msg_from_brace = false # true/false - -# When indenting after virtual brace open and newline add further spaces to -# reach this minimum indent. -indent_min_vbrace_open = 0 # unsigned number - -# Whether to add further spaces after regular indent to reach next tabstop -# when indenting after virtual brace open and newline. -indent_vbrace_open_on_tabstop = false # true/false - -# How to indent after a brace followed by another token (not a newline). -# true: indent all contained lines to match the token -# false: indent all contained lines to match the brace -# -# Default: true -indent_token_after_brace = true # true/false - -# Whether to indent the body of a C++11 lambda. -indent_cpp_lambda_body = false # true/false - -# How to indent compound literals that are being returned. -# true: add both the indent from return & the compound literal open brace (ie: -# 2 indent levels) -# false: only indent 1 level, don't add the indent for the open brace, only add -# the indent for the return. -# -# Default: true -indent_compound_literal_return = true # true/false - -# (C#) Whether to indent a 'using' block if no braces are used. -# -# Default: true -indent_using_block = true # true/false - -# How to indent the continuation of ternary operator. -# -# 0: Off (default) -# 1: When the `if_false` is a continuation, indent it under `if_false` -# 2: When the `:` is a continuation, indent it under `?` -indent_ternary_operator = 0 # unsigned number - -# Whether to indent the statments inside ternary operator. -indent_inside_ternary_operator = false # true/false - -# If true, the indentation of the chunks after a `return` sequence will be set at return indentation column. -indent_off_after_return = false # true/false - -# If true, the indentation of the chunks after a `return new` sequence will be set at return indentation column. -indent_off_after_return_new = false # true/false - -# If true, the tokens after return are indented with regular single indentation. By default (false) the indentation is after the return token. -indent_single_after_return = false # true/false - -# Whether to ignore indent and alignment for 'asm' blocks (i.e. assume they -# have their own indentation). -indent_ignore_asm_block = false # true/false - -# Don't indent the close parenthesis of a function definition, -# if the parenthesis is on its own line. -donot_indent_func_def_close_paren = false # true/false - -# -# Newline adding and removing options -# - -# Whether to collapse empty blocks between '{' and '}'. -# If true, overrides nl_inside_empty_func -nl_collapse_empty_body = false # true/false - -# Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'. -nl_assign_leave_one_liners = false # true/false - -# Don't split one-line braced statements inside a 'class xx { }' body. -nl_class_leave_one_liners = false # true/false - -# Don't split one-line enums, as in 'enum foo { BAR = 15 };' -nl_enum_leave_one_liners = false # true/false - -# Don't split one-line get or set functions. -nl_getset_leave_one_liners = false # true/false - -# (C#) Don't split one-line property get or set functions. -nl_cs_property_leave_one_liners = false # true/false - -# Don't split one-line function definitions, as in 'int foo() { return 0; }'. -# might modify nl_func_type_name -nl_func_leave_one_liners = false # true/false - -# Don't split one-line C++11 lambdas, as in '[]() { return 0; }'. -nl_cpp_lambda_leave_one_liners = false # true/false - -# Don't split one-line if/else statements, as in 'if(...) b++;'. -nl_if_leave_one_liners = false # true/false - -# Don't split one-line while statements, as in 'while(...) b++;'. -nl_while_leave_one_liners = false # true/false - -# Don't split one-line for statements, as in 'for(...) b++;'. -nl_for_leave_one_liners = false # true/false - -# (OC) Don't split one-line Objective-C messages. -nl_oc_msg_leave_one_liner = false # true/false - -# (OC) Add or remove newline between method declaration and '{'. -nl_oc_mdef_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove newline between Objective-C block signature and '{'. -nl_oc_block_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove blank line before '@interface' statement. -nl_oc_before_interface = ignore # ignore/add/remove/force - -# (OC) Add or remove blank line before '@implementation' statement. -nl_oc_before_implementation = ignore # ignore/add/remove/force - -# (OC) Add or remove blank line before '@end' statement. -nl_oc_before_end = ignore # ignore/add/remove/force - -# (OC) Add or remove newline between '@interface' and '{'. -nl_oc_interface_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove newline between '@implementation' and '{'. -nl_oc_implementation_brace = ignore # ignore/add/remove/force - -# Add or remove newlines at the start of the file. -nl_start_of_file = ignore # ignore/add/remove/force - -# The minimum number of newlines at the start of the file (only used if -# nl_start_of_file is 'add' or 'force'). -nl_start_of_file_min = 0 # unsigned number - -# Add or remove newline at the end of the file. -nl_end_of_file = ignore # ignore/add/remove/force - -# The minimum number of newlines at the end of the file (only used if -# nl_end_of_file is 'add' or 'force'). -nl_end_of_file_min = 0 # unsigned number - -# Add or remove newline between '=' and '{'. -nl_assign_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline between '=' and '['. -nl_assign_square = ignore # ignore/add/remove/force - -# Add or remove newline between '[]' and '{'. -nl_tsquare_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline after '= ['. Will also affect the newline before -# the ']'. -nl_after_square_assign = ignore # ignore/add/remove/force - -# Add or remove newline between a function call's ')' and '{', as in -# 'list_for_each(item, &list) { }'. -nl_fcall_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum' and '{'. -nl_enum_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum' and 'class'. -nl_enum_class = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum class' and the identifier. -nl_enum_class_identifier = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum class' type and ':'. -nl_enum_identifier_colon = ignore # ignore/add/remove/force - -# Add or remove newline between 'enum class identifier :' and type. -nl_enum_colon_type = ignore # ignore/add/remove/force - -# Add or remove newline between 'struct and '{'. -nl_struct_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'union' and '{'. -nl_union_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'if' and '{'. -nl_if_brace = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'else'. -nl_brace_else = ignore # ignore/add/remove/force - -# Add or remove newline between 'else if' and '{'. If set to ignore, -# nl_if_brace is used instead. -nl_elseif_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'else' and '{'. -nl_else_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'else' and 'if'. -nl_else_if = ignore # ignore/add/remove/force - -# Add or remove newline before '{' opening brace -nl_before_opening_brace_func_class_def = ignore # ignore/add/remove/force - -# Add or remove newline before 'if'/'else if' closing parenthesis. -nl_before_if_closing_paren = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'finally'. -nl_brace_finally = ignore # ignore/add/remove/force - -# Add or remove newline between 'finally' and '{'. -nl_finally_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'try' and '{'. -nl_try_brace = ignore # ignore/add/remove/force - -# Add or remove newline between get/set and '{'. -nl_getset_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'for' and '{'. -nl_for_brace = ignore # ignore/add/remove/force - -# Add or remove newline before the '{' of a 'catch' statement, as in -# 'catch (decl) {'. -nl_catch_brace = ignore # ignore/add/remove/force - -# (OC) Add or remove newline before the '{' of a '@catch' statement, as in -# '@catch (decl) {'. If set to ignore, nl_catch_brace is used. -nl_oc_catch_brace = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'catch'. -nl_brace_catch = ignore # ignore/add/remove/force - -# (OC) Add or remove newline between '}' and '@catch'. If set to ignore, -# nl_brace_catch is used. -nl_oc_brace_catch = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and ']'. -nl_brace_square = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and ')' in a function invocation. -nl_brace_fparen = ignore # ignore/add/remove/force - -# Add or remove newline between 'while' and '{'. -nl_while_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline between 'scope (x)' and '{'. -nl_scope_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline between 'unittest' and '{'. -nl_unittest_brace = ignore # ignore/add/remove/force - -# (D) Add or remove newline between 'version (x)' and '{'. -nl_version_brace = ignore # ignore/add/remove/force - -# (C#) Add or remove newline between 'using' and '{'. -nl_using_brace = ignore # ignore/add/remove/force - -# Add or remove newline between two open or close braces. Due to general -# newline/brace handling, REMOVE may not work. -nl_brace_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'do' and '{'. -nl_do_brace = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'while' of 'do' statement. -nl_brace_while = ignore # ignore/add/remove/force - -# Add or remove newline between 'switch' and '{'. -nl_switch_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'synchronized' and '{'. -nl_synchronized_brace = ignore # ignore/add/remove/force - -# Add a newline between ')' and '{' if the ')' is on a different line than the -# if/for/etc. -# -# Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch and -# nl_catch_brace. -nl_multi_line_cond = false # true/false - -# Add a newline after '(' if an if/for/while/switch condition spans multiple -# lines -nl_multi_line_sparen_open = ignore # ignore/add/remove/force - -# Add a newline before ')' if an if/for/while/switch condition spans multiple -# lines. Overrides nl_before_if_closing_paren if both are specified. -nl_multi_line_sparen_close = ignore # ignore/add/remove/force - -# Force a newline in a define after the macro name for multi-line defines. -nl_multi_line_define = false # true/false - -# Whether to add a newline before 'case', and a blank line before a 'case' -# statement that follows a ';' or '}'. -nl_before_case = false # true/false - -# Whether to add a newline after a 'case' statement. -nl_after_case = false # true/false - -# Add or remove newline between a case ':' and '{'. -# -# Overrides nl_after_case. -nl_case_colon_brace = ignore # ignore/add/remove/force - -# Add or remove newline between ')' and 'throw'. -nl_before_throw = ignore # ignore/add/remove/force - -# Add or remove newline between 'namespace' and '{'. -nl_namespace_brace = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template class. -nl_template_class = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template class declaration. -# -# Overrides nl_template_class. -nl_template_class_decl = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<>' of a specialized class declaration. -# -# Overrides nl_template_class_decl. -nl_template_class_decl_special = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template class definition. -# -# Overrides nl_template_class. -nl_template_class_def = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<>' of a specialized class definition. -# -# Overrides nl_template_class_def. -nl_template_class_def_special = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template function. -nl_template_func = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template function -# declaration. -# -# Overrides nl_template_func. -nl_template_func_decl = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<>' of a specialized function -# declaration. -# -# Overrides nl_template_func_decl. -nl_template_func_decl_special = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template function -# definition. -# -# Overrides nl_template_func. -nl_template_func_def = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<>' of a specialized function -# definition. -# -# Overrides nl_template_func_def. -nl_template_func_def_special = ignore # ignore/add/remove/force - -# Add or remove newline after 'template<...>' of a template variable. -nl_template_var = ignore # ignore/add/remove/force - -# Add or remove newline between 'template<...>' and 'using' of a templated -# type alias. -nl_template_using = ignore # ignore/add/remove/force - -# Add or remove newline between 'class' and '{'. -nl_class_brace = ignore # ignore/add/remove/force - -# Add or remove newline before or after (depending on pos_class_comma, -# may not be IGNORE) each',' in the base class list. -nl_class_init_args = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in the constructor member -# initialization. Related to nl_constr_colon, pos_constr_colon and -# pos_constr_comma. -nl_constr_init_args = ignore # ignore/add/remove/force - -# Add or remove newline before first element, after comma, and after last -# element, in 'enum'. -nl_enum_own_lines = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name in a function -# definition. -# might be modified by nl_func_leave_one_liners -nl_func_type_name = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name inside a class -# definition. If set to ignore, nl_func_type_name or nl_func_proto_type_name -# is used instead. -nl_func_type_name_class = ignore # ignore/add/remove/force - -# Add or remove newline between class specification and '::' -# in 'void A::f() { }'. Only appears in separate member implementation (does -# not appear with in-line implementation). -nl_func_class_scope = ignore # ignore/add/remove/force - -# Add or remove newline between function scope and name, as in -# 'void A :: f() { }'. -nl_func_scope_name = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name in a prototype. -nl_func_proto_type_name = ignore # ignore/add/remove/force - -# Add or remove newline between a function name and the opening '(' in the -# declaration. -nl_func_paren = ignore # ignore/add/remove/force - -# Overrides nl_func_paren for functions with no parameters. -nl_func_paren_empty = ignore # ignore/add/remove/force - -# Add or remove newline between a function name and the opening '(' in the -# definition. -nl_func_def_paren = ignore # ignore/add/remove/force - -# Overrides nl_func_def_paren for functions with no parameters. -nl_func_def_paren_empty = ignore # ignore/add/remove/force - -# Add or remove newline between a function name and the opening '(' in the -# call. -nl_func_call_paren = ignore # ignore/add/remove/force - -# Overrides nl_func_call_paren for functions with no parameters. -nl_func_call_paren_empty = ignore # ignore/add/remove/force - -# Add or remove newline after '(' in a function declaration. -nl_func_decl_start = ignore # ignore/add/remove/force - -# Add or remove newline after '(' in a function definition. -nl_func_def_start = ignore # ignore/add/remove/force - -# Overrides nl_func_decl_start when there is only one parameter. -nl_func_decl_start_single = ignore # ignore/add/remove/force - -# Overrides nl_func_def_start when there is only one parameter. -nl_func_def_start_single = ignore # ignore/add/remove/force - -# Whether to add a newline after '(' in a function declaration if '(' and ')' -# are in different lines. If false, nl_func_decl_start is used instead. -nl_func_decl_start_multi_line = false # true/false - -# Whether to add a newline after '(' in a function definition if '(' and ')' -# are in different lines. If false, nl_func_def_start is used instead. -nl_func_def_start_multi_line = false # true/false - -# Add or remove newline after each ',' in a function declaration. -nl_func_decl_args = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in a function definition. -nl_func_def_args = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in a function call. -nl_func_call_args = ignore # ignore/add/remove/force - -# Whether to add a newline after each ',' in a function declaration if '(' -# and ')' are in different lines. If false, nl_func_decl_args is used instead. -nl_func_decl_args_multi_line = false # true/false - -# Whether to add a newline after each ',' in a function definition if '(' -# and ')' are in different lines. If false, nl_func_def_args is used instead. -nl_func_def_args_multi_line = false # true/false - -# Add or remove newline before the ')' in a function declaration. -nl_func_decl_end = ignore # ignore/add/remove/force - -# Add or remove newline before the ')' in a function definition. -nl_func_def_end = ignore # ignore/add/remove/force - -# Overrides nl_func_decl_end when there is only one parameter. -nl_func_decl_end_single = ignore # ignore/add/remove/force - -# Overrides nl_func_def_end when there is only one parameter. -nl_func_def_end_single = ignore # ignore/add/remove/force - -# Whether to add a newline before ')' in a function declaration if '(' and ')' -# are in different lines. If false, nl_func_decl_end is used instead. -nl_func_decl_end_multi_line = false # true/false - -# Whether to add a newline before ')' in a function definition if '(' and ')' -# are in different lines. If false, nl_func_def_end is used instead. -nl_func_def_end_multi_line = false # true/false - -# Add or remove newline between '()' in a function declaration. -nl_func_decl_empty = ignore # ignore/add/remove/force - -# Add or remove newline between '()' in a function definition. -nl_func_def_empty = ignore # ignore/add/remove/force - -# Add or remove newline between '()' in a function call. -nl_func_call_empty = ignore # ignore/add/remove/force - -# Whether to add a newline after '(' in a function call, -# has preference over nl_func_call_start_multi_line. -nl_func_call_start = ignore # ignore/add/remove/force - -# Whether to add a newline before ')' in a function call. -nl_func_call_end = ignore # ignore/add/remove/force - -# Whether to add a newline after '(' in a function call if '(' and ')' are in -# different lines. -nl_func_call_start_multi_line = false # true/false - -# Whether to add a newline after each ',' in a function call if '(' and ')' -# are in different lines. -nl_func_call_args_multi_line = false # true/false - -# Whether to add a newline before ')' in a function call if '(' and ')' are in -# different lines. -nl_func_call_end_multi_line = false # true/false - -# Whether to respect nl_func_call_XXX option incase of closure args. -nl_func_call_args_multi_line_ignore_closures = false # true/false - -# Whether to add a newline after '<' of a template parameter list. -nl_template_start = false # true/false - -# Whether to add a newline after each ',' in a template parameter list. -nl_template_args = false # true/false - -# Whether to add a newline before '>' of a template parameter list. -nl_template_end = false # true/false - -# (OC) Whether to put each Objective-C message parameter on a separate line. -# See nl_oc_msg_leave_one_liner. -nl_oc_msg_args = false # true/false - -# Add or remove newline between function signature and '{'. -nl_fdef_brace = ignore # ignore/add/remove/force - -# Add or remove newline between function signature and '{', -# if signature ends with ')'. Overrides nl_fdef_brace. -nl_fdef_brace_cond = ignore # ignore/add/remove/force - -# Add or remove newline between C++11 lambda signature and '{'. -nl_cpp_ldef_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'return' and the return expression. -nl_return_expr = ignore # ignore/add/remove/force - -# Whether to add a newline after semicolons, except in 'for' statements. -nl_after_semicolon = false # true/false - -# (Java) Add or remove newline between the ')' and '{{' of the double brace -# initializer. -nl_paren_dbrace_open = ignore # ignore/add/remove/force - -# Whether to add a newline after the type in an unnamed temporary -# direct-list-initialization. -nl_type_brace_init_lst = ignore # ignore/add/remove/force - -# Whether to add a newline after the open brace in an unnamed temporary -# direct-list-initialization. -nl_type_brace_init_lst_open = ignore # ignore/add/remove/force - -# Whether to add a newline before the close brace in an unnamed temporary -# direct-list-initialization. -nl_type_brace_init_lst_close = ignore # ignore/add/remove/force - -# Whether to add a newline after '{'. This also adds a newline before the -# matching '}'. -nl_after_brace_open = false # true/false - -# Whether to add a newline between the open brace and a trailing single-line -# comment. Requires nl_after_brace_open=true. -nl_after_brace_open_cmt = false # true/false - -# Whether to add a newline after a virtual brace open with a non-empty body. -# These occur in un-braced if/while/do/for statement bodies. -nl_after_vbrace_open = false # true/false - -# Whether to add a newline after a virtual brace open with an empty body. -# These occur in un-braced if/while/do/for statement bodies. -nl_after_vbrace_open_empty = false # true/false - -# Whether to add a newline after '}'. Does not apply if followed by a -# necessary ';'. -nl_after_brace_close = false # true/false - -# Whether to add a newline after a virtual brace close, -# as in 'if (foo) a++; return;'. -nl_after_vbrace_close = false # true/false - -# Add or remove newline between the close brace and identifier, -# as in 'struct { int a; } b;'. Affects enumerations, unions and -# structures. If set to ignore, uses nl_after_brace_close. -nl_brace_struct_var = ignore # ignore/add/remove/force - -# Whether to alter newlines in '#define' macros. -nl_define_macro = false # true/false - -# Whether to alter newlines between consecutive parenthesis closes. The number -# of closing parentheses in a line will depend on respective open parenthesis -# lines. -nl_squeeze_paren_close = false # true/false - -# Whether to remove blanks after '#ifxx' and '#elxx', or before '#elxx' and -# '#endif'. Does not affect top-level #ifdefs. -nl_squeeze_ifdef = false # true/false - -# Makes the nl_squeeze_ifdef option affect the top-level #ifdefs as well. -nl_squeeze_ifdef_top_level = false # true/false - -# Add or remove blank line before 'if'. -nl_before_if = ignore # ignore/add/remove/force - -# Add or remove blank line after 'if' statement. Add/Force work only if the -# next token is not a closing brace. -nl_after_if = ignore # ignore/add/remove/force - -# Add or remove blank line before 'for'. -nl_before_for = ignore # ignore/add/remove/force - -# Add or remove blank line after 'for' statement. -nl_after_for = ignore # ignore/add/remove/force - -# Add or remove blank line before 'while'. -nl_before_while = ignore # ignore/add/remove/force - -# Add or remove blank line after 'while' statement. -nl_after_while = ignore # ignore/add/remove/force - -# Add or remove blank line before 'switch'. -nl_before_switch = ignore # ignore/add/remove/force - -# Add or remove blank line after 'switch' statement. -nl_after_switch = ignore # ignore/add/remove/force - -# Add or remove blank line before 'synchronized'. -nl_before_synchronized = ignore # ignore/add/remove/force - -# Add or remove blank line after 'synchronized' statement. -nl_after_synchronized = ignore # ignore/add/remove/force - -# Add or remove blank line before 'do'. -nl_before_do = ignore # ignore/add/remove/force - -# Add or remove blank line after 'do/while' statement. -nl_after_do = ignore # ignore/add/remove/force - -# Whether to put a blank line before 'return' statements, unless after an open -# brace. -nl_before_return = false # true/false - -# Whether to put a blank line after 'return' statements, unless followed by a -# close brace. -nl_after_return = false # true/false - -# Whether to put a blank line before a member '.' or '->' operators. -nl_before_member = ignore # ignore/add/remove/force - -# (Java) Whether to put a blank line after a member '.' or '->' operators. -nl_after_member = ignore # ignore/add/remove/force - -# Whether to double-space commented-entries in 'struct'/'union'/'enum'. -nl_ds_struct_enum_cmt = false # true/false - -# Whether to force a newline before '}' of a 'struct'/'union'/'enum'. -# (Lower priority than eat_blanks_before_close_brace.) -nl_ds_struct_enum_close_brace = false # true/false - -# Add or remove newline before or after (depending on pos_class_colon) a class -# colon, as in 'class Foo : public Bar'. -nl_class_colon = ignore # ignore/add/remove/force - -# Add or remove newline around a class constructor colon. The exact position -# depends on nl_constr_init_args, pos_constr_colon and pos_constr_comma. -nl_constr_colon = ignore # ignore/add/remove/force - -# Whether to collapse a two-line namespace, like 'namespace foo\n{ decl; }' -# into a single line. If true, prevents other brace newline rules from turning -# such code into four lines. -nl_namespace_two_to_one_liner = false # true/false - -# Whether to remove a newline in simple unbraced if statements, turning them -# into one-liners, as in 'if(b)\n i++;' => 'if(b) i++;'. -nl_create_if_one_liner = false # true/false - -# Whether to remove a newline in simple unbraced for statements, turning them -# into one-liners, as in 'for (...)\n stmt;' => 'for (...) stmt;'. -nl_create_for_one_liner = false # true/false - -# Whether to remove a newline in simple unbraced while statements, turning -# them into one-liners, as in 'while (expr)\n stmt;' => 'while (expr) stmt;'. -nl_create_while_one_liner = false # true/false - -# Whether to collapse a function definition whose body (not counting braces) -# is only one line so that the entire definition (prototype, braces, body) is -# a single line. -nl_create_func_def_one_liner = false # true/false - -# Whether to collapse a function definition whose body (not counting braces) -# is only one line so that the entire definition (prototype, braces, body) is -# a single line. -nl_create_list_one_liner = false # true/false - -# Whether to split one-line simple unbraced if statements into two lines by -# adding a newline, as in 'if(b) i++;'. -nl_split_if_one_liner = false # true/false - -# Whether to split one-line simple unbraced for statements into two lines by -# adding a newline, as in 'for (...) stmt;'. -nl_split_for_one_liner = false # true/false - -# Whether to split one-line simple unbraced while statements into two lines by -# adding a newline, as in 'while (expr) stmt;'. -nl_split_while_one_liner = false # true/false - -# Don't add a newline before a cpp-comment in a parameter list of a function -# call. -donot_add_nl_before_cpp_comment = false # true/false - -# -# Blank line options -# - -# The maximum number of consecutive newlines (3 = 2 blank lines). -nl_max = 0 # unsigned number - -# The maximum number of consecutive newlines in a function. -nl_max_blank_in_func = 0 # unsigned number - -# The number of newlines inside an empty function body. -# This option is overridden by nl_collapse_empty_body=true -nl_inside_empty_func = 0 # unsigned number - -# The number of newlines before a function prototype. -nl_before_func_body_proto = 0 # unsigned number - -# The number of newlines before a multi-line function definition. -nl_before_func_body_def = 0 # unsigned number - -# The number of newlines before a class constructor/destructor prototype. -nl_before_func_class_proto = 0 # unsigned number - -# The number of newlines before a class constructor/destructor definition. -nl_before_func_class_def = 0 # unsigned number - -# The number of newlines after a function prototype. -nl_after_func_proto = 0 # unsigned number - -# The number of newlines after a function prototype, if not followed by -# another function prototype. -nl_after_func_proto_group = 0 # unsigned number - -# The number of newlines after a class constructor/destructor prototype. -nl_after_func_class_proto = 0 # unsigned number - -# The number of newlines after a class constructor/destructor prototype, -# if not followed by another constructor/destructor prototype. -nl_after_func_class_proto_group = 0 # unsigned number - -# Whether one-line method definitions inside a class body should be treated -# as if they were prototypes for the purposes of adding newlines. -# -# Requires nl_class_leave_one_liners=true. Overrides nl_before_func_body_def -# and nl_before_func_class_def for one-liners. -nl_class_leave_one_liner_groups = false # true/false - -# The number of newlines after '}' of a multi-line function body. -nl_after_func_body = 0 # unsigned number - -# The number of newlines after '}' of a multi-line function body in a class -# declaration. Also affects class constructors/destructors. -# -# Overrides nl_after_func_body. -nl_after_func_body_class = 0 # unsigned number - -# The number of newlines after '}' of a single line function body. Also -# affects class constructors/destructors. -# -# Overrides nl_after_func_body and nl_after_func_body_class. -nl_after_func_body_one_liner = 0 # unsigned number - -# The number of blank lines after a block of variable definitions at the top -# of a function body. -# -# 0: No change (default). -nl_func_var_def_blk = 0 # unsigned number - -# The number of newlines before a block of typedefs. If nl_after_access_spec -# is non-zero, that option takes precedence. -# -# 0: No change (default). -nl_typedef_blk_start = 0 # unsigned number - -# The number of newlines after a block of typedefs. -# -# 0: No change (default). -nl_typedef_blk_end = 0 # unsigned number - -# The maximum number of consecutive newlines within a block of typedefs. -# -# 0: No change (default). -nl_typedef_blk_in = 0 # unsigned number - -# The number of newlines before a block of variable definitions not at the top -# of a function body. If nl_after_access_spec is non-zero, that option takes -# precedence. -# -# 0: No change (default). -nl_var_def_blk_start = 0 # unsigned number - -# The number of newlines after a block of variable definitions not at the top -# of a function body. -# -# 0: No change (default). -nl_var_def_blk_end = 0 # unsigned number - -# The maximum number of consecutive newlines within a block of variable -# definitions. -# -# 0: No change (default). -nl_var_def_blk_in = 0 # unsigned number - -# The minimum number of newlines before a multi-line comment. -# Doesn't apply if after a brace open or another multi-line comment. -nl_before_block_comment = 0 # unsigned number - -# The minimum number of newlines before a single-line C comment. -# Doesn't apply if after a brace open or other single-line C comments. -nl_before_c_comment = 0 # unsigned number - -# The minimum number of newlines before a CPP comment. -# Doesn't apply if after a brace open or other CPP comments. -nl_before_cpp_comment = 0 # unsigned number - -# Whether to force a newline after a multi-line comment. -nl_after_multiline_comment = false # true/false - -# Whether to force a newline after a label's colon. -nl_after_label_colon = false # true/false - -# The number of newlines after '}' or ';' of a struct/enum/union definition. -nl_after_struct = 0 # unsigned number - -# The number of newlines before a class definition. -nl_before_class = 0 # unsigned number - -# The number of newlines after '}' or ';' of a class definition. -nl_after_class = 0 # unsigned number - -# The number of newlines before a namespace. -nl_before_namespace = 0 # unsigned number - -# The number of newlines after '{' of a namespace. This also adds newlines -# before the matching '}'. -# -# 0: Apply eat_blanks_after_open_brace or eat_blanks_before_close_brace if -# applicable, otherwise no change. -# -# Overrides eat_blanks_after_open_brace and eat_blanks_before_close_brace. -nl_inside_namespace = 0 # unsigned number - -# The number of newlines after '}' of a namespace. -nl_after_namespace = 0 # unsigned number - -# The number of newlines before an access specifier label. This also includes -# the Qt-specific 'signals:' and 'slots:'. Will not change the newline count -# if after a brace open. -# -# 0: No change (default). -nl_before_access_spec = 0 # unsigned number - -# The number of newlines after an access specifier label. This also includes -# the Qt-specific 'signals:' and 'slots:'. Will not change the newline count -# if after a brace open. -# -# 0: No change (default). -# -# Overrides nl_typedef_blk_start and nl_var_def_blk_start. -nl_after_access_spec = 0 # unsigned number - -# The number of newlines between a function definition and the function -# comment, as in '// comment\n void foo() {...}'. -# -# 0: No change (default). -nl_comment_func_def = 0 # unsigned number - -# The number of newlines after a try-catch-finally block that isn't followed -# by a brace close. -# -# 0: No change (default). -nl_after_try_catch_finally = 0 # unsigned number - -# (C#) The number of newlines before and after a property, indexer or event -# declaration. -# -# 0: No change (default). -nl_around_cs_property = 0 # unsigned number - -# (C#) The number of newlines between the get/set/add/remove handlers. -# -# 0: No change (default). -nl_between_get_set = 0 # unsigned number - -# (C#) Add or remove newline between property and the '{'. -nl_property_brace = ignore # ignore/add/remove/force - -# Whether to remove blank lines after '{'. -eat_blanks_after_open_brace = false # true/false - -# Whether to remove blank lines before '}'. -eat_blanks_before_close_brace = false # true/false - -# How aggressively to remove extra newlines not in preprocessor. -# -# 0: No change (default) -# 1: Remove most newlines not handled by other config -# 2: Remove all newlines and reformat completely by config -nl_remove_extra_newlines = 0 # unsigned number - -# (Java) Add or remove newline after an annotation statement. Only affects -# annotations that are after a newline. -nl_after_annotation = ignore # ignore/add/remove/force - -# (Java) Add or remove newline between two annotations. -nl_between_annotation = ignore # ignore/add/remove/force - -# The number of newlines before a whole-file #ifdef. -# -# 0: No change (default). -nl_before_whole_file_ifdef = 0 # unsigned number - -# The number of newlines after a whole-file #ifdef. -# -# 0: No change (default). -nl_after_whole_file_ifdef = 0 # unsigned number - -# The number of newlines before a whole-file #endif. -# -# 0: No change (default). -nl_before_whole_file_endif = 0 # unsigned number - -# The number of newlines after a whole-file #endif. -# -# 0: No change (default). -nl_after_whole_file_endif = 0 # unsigned number - -# -# Positioning options -# - -# The position of arithmetic operators in wrapped expressions. -pos_arith = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of assignment in wrapped expressions. Do not affect '=' -# followed by '{'. -pos_assign = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of Boolean operators in wrapped expressions. -pos_bool = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of comparison operators in wrapped expressions. -pos_compare = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of conditional operators, as in the '?' and ':' of -# 'expr ? stmt : stmt', in wrapped expressions. -pos_conditional = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of the comma in wrapped expressions. -pos_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of the comma in enum entries. -pos_enum_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of the comma in the base class list if there is more than one -# line. Affects nl_class_init_args. -pos_class_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of the comma in the constructor initialization list. -# Related to nl_constr_colon, nl_constr_init_args and pos_constr_colon. -pos_constr_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of trailing/leading class colon, between class and base class -# list. Affects nl_class_colon. -pos_class_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of colons between constructor and member initialization. -# Related to nl_constr_colon, nl_constr_init_args and pos_constr_comma. -pos_constr_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# The position of shift operators in wrapped expressions. -pos_shift = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force - -# -# Line splitting options -# - -# Try to limit code width to N columns. -code_width = 0 # unsigned number - -# Whether to fully split long 'for' statements at semi-colons. -ls_for_split_full = false # true/false - -# Whether to fully split long function prototypes/calls at commas. -# The option ls_code_width has priority over the option ls_func_split_full. -ls_func_split_full = false # true/false - -# Whether to split lines as close to code_width as possible and ignore some -# groupings. -# The option ls_code_width has priority over the option ls_func_split_full. -ls_code_width = false # true/false - -# -# Code alignment options (not left column spaces/tabs) -# - -# Whether to keep non-indenting tabs. -align_keep_tabs = false # true/false - -# Whether to use tabs for aligning. -align_with_tabs = false # true/false - -# Whether to bump out to the next tab when aligning. -align_on_tabstop = false # true/false - -# Whether to right-align numbers. -align_number_right = false # true/false - -# Whether to keep whitespace not required for alignment. -align_keep_extra_space = false # true/false - -# Whether to align variable definitions in prototypes and functions. -align_func_params = false # true/false - -# The span for aligning parameter definitions in function on parameter name. -# -# 0: Don't align (default). -align_func_params_span = 0 # unsigned number - -# The threshold for aligning function parameter definitions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_func_params_thresh = 0 # number - -# The gap for aligning function parameter definitions. -align_func_params_gap = 0 # unsigned number - -# The span for aligning constructor value. -# -# 0: Don't align (default). -align_constr_value_span = 0 # unsigned number - -# The threshold for aligning constructor value. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_constr_value_thresh = 0 # number - -# The gap for aligning constructor value. -align_constr_value_gap = 0 # unsigned number - -# Whether to align parameters in single-line functions that have the same -# name. The function names must already be aligned with each other. -align_same_func_call_params = false # true/false - -# The span for aligning function-call parameters for single line functions. -# -# 0: Don't align (default). -align_same_func_call_params_span = 0 # unsigned number - -# The threshold for aligning function-call parameters for single line -# functions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_same_func_call_params_thresh = 0 # number - -# The span for aligning variable definitions. -# -# 0: Don't align (default). -align_var_def_span = 0 # unsigned number - -# How to consider (or treat) the '*' in the alignment of variable definitions. -# -# 0: Part of the type 'void * foo;' (default) -# 1: Part of the variable 'void *foo;' -# 2: Dangling 'void *foo;' -# Dangling: the '*' will not be taken into account when aligning. -align_var_def_star_style = 0 # unsigned number - -# How to consider (or treat) the '&' in the alignment of variable definitions. -# -# 0: Part of the type 'long & foo;' (default) -# 1: Part of the variable 'long &foo;' -# 2: Dangling 'long &foo;' -# Dangling: the '&' will not be taken into account when aligning. -align_var_def_amp_style = 0 # unsigned number - -# The threshold for aligning variable definitions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_var_def_thresh = 0 # number - -# The gap for aligning variable definitions. -align_var_def_gap = 0 # unsigned number - -# Whether to align the colon in struct bit fields. -align_var_def_colon = false # true/false - -# The gap for aligning the colon in struct bit fields. -align_var_def_colon_gap = 0 # unsigned number - -# Whether to align any attribute after the variable name. -align_var_def_attribute = false # true/false - -# Whether to align inline struct/enum/union variable definitions. -align_var_def_inline = false # true/false - -# The span for aligning on '=' in assignments. -# -# 0: Don't align (default). -align_assign_span = 0 # unsigned number - -# The span for aligning on '=' in function prototype modifier. -# -# 0: Don't align (default). -align_assign_func_proto_span = 0 # unsigned number - -# The threshold for aligning on '=' in assignments. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_assign_thresh = 0 # number - -# How to apply align_assign_span to function declaration "assignments", i.e. -# 'virtual void foo() = 0' or '~foo() = {default|delete}'. -# -# 0: Align with other assignments (default) -# 1: Align with each other, ignoring regular assignments -# 2: Don't align -align_assign_decl_func = 0 # unsigned number - -# The span for aligning on '=' in enums. -# -# 0: Don't align (default). -align_enum_equ_span = 0 # unsigned number - -# The threshold for aligning on '=' in enums. -# Use a negative number for absolute thresholds. -# -# 0: no limit (default). -align_enum_equ_thresh = 0 # number - -# The span for aligning class member definitions. -# -# 0: Don't align (default). -align_var_class_span = 0 # unsigned number - -# The threshold for aligning class member definitions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_var_class_thresh = 0 # number - -# The gap for aligning class member definitions. -align_var_class_gap = 0 # unsigned number - -# The span for aligning struct/union member definitions. -# -# 0: Don't align (default). -align_var_struct_span = 0 # unsigned number - -# The threshold for aligning struct/union member definitions. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_var_struct_thresh = 0 # number - -# The gap for aligning struct/union member definitions. -align_var_struct_gap = 0 # unsigned number - -# The span for aligning struct initializer values. -# -# 0: Don't align (default). -align_struct_init_span = 0 # unsigned number - -# The span for aligning single-line typedefs. -# -# 0: Don't align (default). -align_typedef_span = 0 # unsigned number - -# The minimum space between the type and the synonym of a typedef. -align_typedef_gap = 0 # unsigned number - -# How to align typedef'd functions with other typedefs. -# -# 0: Don't mix them at all (default) -# 1: Align the open parenthesis with the types -# 2: Align the function type name with the other type names -align_typedef_func = 0 # unsigned number - -# How to consider (or treat) the '*' in the alignment of typedefs. -# -# 0: Part of the typedef type, 'typedef int * pint;' (default) -# 1: Part of type name: 'typedef int *pint;' -# 2: Dangling: 'typedef int *pint;' -# Dangling: the '*' will not be taken into account when aligning. -align_typedef_star_style = 0 # unsigned number - -# How to consider (or treat) the '&' in the alignment of typedefs. -# -# 0: Part of the typedef type, 'typedef int & intref;' (default) -# 1: Part of type name: 'typedef int &intref;' -# 2: Dangling: 'typedef int &intref;' -# Dangling: the '&' will not be taken into account when aligning. -align_typedef_amp_style = 0 # unsigned number - -# The span for aligning comments that end lines. -# -# 0: Don't align (default). -align_right_cmt_span = 0 # unsigned number - -# Minimum number of columns between preceding text and a trailing comment in -# order for the comment to qualify for being aligned. Must be non-zero to have -# an effect. -align_right_cmt_gap = 0 # unsigned number - -# If aligning comments, whether to mix with comments after '}' and #endif with -# less than three spaces before the comment. -align_right_cmt_mix = false # true/false - -# Whether to only align trailing comments that are at the same brace level. -align_right_cmt_same_level = false # true/false - -# Minimum column at which to align trailing comments. Comments which are -# aligned beyond this column, but which can be aligned in a lesser column, -# may be "pulled in". -# -# 0: Ignore (default). -align_right_cmt_at_col = 0 # unsigned number - -# The span for aligning function prototypes. -# -# 0: Don't align (default). -align_func_proto_span = 0 # unsigned number - -# The threshold for aligning function prototypes. -# Use a negative number for absolute thresholds. -# -# 0: No limit (default). -align_func_proto_thresh = 0 # number - -# Minimum gap between the return type and the function name. -align_func_proto_gap = 0 # unsigned number - -# Whether to align function prototypes on the 'operator' keyword instead of -# what follows. -align_on_operator = false # true/false - -# Whether to mix aligning prototype and variable declarations. If true, -# align_var_def_XXX options are used instead of align_func_proto_XXX options. -align_mix_var_proto = false # true/false - -# Whether to align single-line functions with function prototypes. -# Uses align_func_proto_span. -align_single_line_func = false # true/false - -# Whether to align the open brace of single-line functions. -# Requires align_single_line_func=true. Uses align_func_proto_span. -align_single_line_brace = false # true/false - -# Gap for align_single_line_brace. -align_single_line_brace_gap = 0 # unsigned number - -# (OC) The span for aligning Objective-C message specifications. -# -# 0: Don't align (default). -align_oc_msg_spec_span = 0 # unsigned number - -# Whether to align macros wrapped with a backslash and a newline. This will -# not work right if the macro contains a multi-line comment. -align_nl_cont = false # true/false - -# Whether to align macro functions and variables together. -align_pp_define_together = false # true/false - -# The span for aligning on '#define' bodies. -# -# =0: Don't align (default) -# >0: Number of lines (including comments) between blocks -align_pp_define_span = 0 # unsigned number - -# The minimum space between label and value of a preprocessor define. -align_pp_define_gap = 0 # unsigned number - -# Whether to align lines that start with '<<' with previous '<<'. -# -# Default: true -align_left_shift = true # true/false - -# Whether to align comma-separated statements following '<<' (as used to -# initialize Eigen matrices). -align_eigen_comma_init = false # true/false - -# Whether to align text after 'asm volatile ()' colons. -align_asm_colon = false # true/false - -# (OC) Span for aligning parameters in an Objective-C message call -# on the ':'. -# -# 0: Don't align. -align_oc_msg_colon_span = 0 # unsigned number - -# (OC) Whether to always align with the first parameter, even if it is too -# short. -align_oc_msg_colon_first = false # true/false - -# (OC) Whether to align parameters in an Objective-C '+' or '-' declaration -# on the ':'. -align_oc_decl_colon = false # true/false - -# (OC) Whether to not align parameters in an Objectve-C message call if first -# colon is not on next line of the message call (the same way Xcode does -# aligment) -align_oc_msg_colon_xcode_like = false # true/false - -# -# Comment modification options -# - -# Try to wrap comments at N columns. -cmt_width = 0 # unsigned number - -# How to reflow comments. -# -# 0: No reflowing (apart from the line wrapping due to cmt_width) (default) -# 1: No touching at all -# 2: Full reflow -cmt_reflow_mode = 0 # unsigned number - -# Whether to convert all tabs to spaces in comments. If false, tabs in -# comments are left alone, unless used for indenting. -cmt_convert_tab_to_spaces = false # true/false - -# Whether to apply changes to multi-line comments, including cmt_width, -# keyword substitution and leading chars. -# -# Default: true -cmt_indent_multi = true # true/false - -# Whether to group c-comments that look like they are in a block. -cmt_c_group = false # true/false - -# Whether to put an empty '/*' on the first line of the combined c-comment. -cmt_c_nl_start = false # true/false - -# Whether to add a newline before the closing '*/' of the combined c-comment. -cmt_c_nl_end = false # true/false - -# Whether to change cpp-comments into c-comments. -cmt_cpp_to_c = false # true/false - -# Whether to group cpp-comments that look like they are in a block. Only -# meaningful if cmt_cpp_to_c=true. -cmt_cpp_group = false # true/false - -# Whether to put an empty '/*' on the first line of the combined cpp-comment -# when converting to a c-comment. -# -# Requires cmt_cpp_to_c=true and cmt_cpp_group=true. -cmt_cpp_nl_start = false # true/false - -# Whether to add a newline before the closing '*/' of the combined cpp-comment -# when converting to a c-comment. -# -# Requires cmt_cpp_to_c=true and cmt_cpp_group=true. -cmt_cpp_nl_end = false # true/false - -# Whether to put a star on subsequent comment lines. -cmt_star_cont = false # true/false - -# The number of spaces to insert at the start of subsequent comment lines. -cmt_sp_before_star_cont = 0 # unsigned number - -# The number of spaces to insert after the star on subsequent comment lines. -cmt_sp_after_star_cont = 0 # unsigned number - -# For multi-line comments with a '*' lead, remove leading spaces if the first -# and last lines of the comment are the same length. -# -# Default: true -cmt_multi_check_last = true # true/false - -# For multi-line comments with a '*' lead, remove leading spaces if the first -# and last lines of the comment are the same length AND if the length is -# bigger as the first_len minimum. -# -# Default: 4 -cmt_multi_first_len_minimum = 4 # unsigned number - -# Path to a file that contains text to insert at the beginning of a file if -# the file doesn't start with a C/C++ comment. If the inserted text contains -# '$(filename)', that will be replaced with the current file's name. -cmt_insert_file_header = "" # string - -# Path to a file that contains text to insert at the end of a file if the -# file doesn't end with a C/C++ comment. If the inserted text contains -# '$(filename)', that will be replaced with the current file's name. -cmt_insert_file_footer = "" # string - -# Path to a file that contains text to insert before a function definition if -# the function isn't preceded by a C/C++ comment. If the inserted text -# contains '$(function)', '$(javaparam)' or '$(fclass)', these will be -# replaced with, respectively, the name of the function, the javadoc '@param' -# and '@return' stuff, or the name of the class to which the member function -# belongs. -cmt_insert_func_header = "" # string - -# Path to a file that contains text to insert before a class if the class -# isn't preceded by a C/C++ comment. If the inserted text contains '$(class)', -# that will be replaced with the class name. -cmt_insert_class_header = "" # string - -# Path to a file that contains text to insert before an Objective-C message -# specification, if the method isn't preceded by a C/C++ comment. If the -# inserted text contains '$(message)' or '$(javaparam)', these will be -# replaced with, respectively, the name of the function, or the javadoc -# '@param' and '@return' stuff. -cmt_insert_oc_msg_header = "" # string - -# Whether a comment should be inserted if a preprocessor is encountered when -# stepping backwards from a function name. -# -# Applies to cmt_insert_oc_msg_header, cmt_insert_func_header and -# cmt_insert_class_header. -cmt_insert_before_preproc = false # true/false - -# Whether a comment should be inserted if a function is declared inline to a -# class definition. -# -# Applies to cmt_insert_func_header. -# -# Default: true -cmt_insert_before_inlines = true # true/false - -# Whether a comment should be inserted if the function is a class constructor -# or destructor. -# -# Applies to cmt_insert_func_header. -cmt_insert_before_ctor_dtor = false # true/false - -# -# Code modifying options (non-whitespace) -# - -# Add or remove braces on a single-line 'do' statement. -mod_full_brace_do = ignore # ignore/add/remove/force - -# Add or remove braces on a single-line 'for' statement. -mod_full_brace_for = ignore # ignore/add/remove/force - -# (Pawn) Add or remove braces on a single-line function definition. -mod_full_brace_function = ignore # ignore/add/remove/force - -# Add or remove braces on a single-line 'if' statement. Braces will not be -# removed if the braced statement contains an 'else'. -mod_full_brace_if = ignore # ignore/add/remove/force - -# Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either -# have, or do not have, braces. If true, braces will be added if any block -# needs braces, and will only be removed if they can be removed from all -# blocks. -# -# Overrides mod_full_brace_if. -mod_full_brace_if_chain = false # true/false - -# Whether to add braces to all blocks of an 'if'/'else if'/'else' chain. -# If true, mod_full_brace_if_chain will only remove braces from an 'if' that -# does not have an 'else if' or 'else'. -mod_full_brace_if_chain_only = false # true/false - -# Add or remove braces on single-line 'while' statement. -mod_full_brace_while = ignore # ignore/add/remove/force - -# Add or remove braces on single-line 'using ()' statement. -mod_full_brace_using = ignore # ignore/add/remove/force - -# Don't remove braces around statements that span N newlines -mod_full_brace_nl = 0 # unsigned number - -# Whether to prevent removal of braces from 'if'/'for'/'while'/etc. blocks -# which span multiple lines. -# -# Affects: -# mod_full_brace_for -# mod_full_brace_if -# mod_full_brace_if_chain -# mod_full_brace_if_chain_only -# mod_full_brace_while -# mod_full_brace_using -# -# Does not affect: -# mod_full_brace_do -# mod_full_brace_function -mod_full_brace_nl_block_rem_mlcond = false # true/false - -# Add or remove unnecessary parenthesis on 'return' statement. -mod_paren_on_return = ignore # ignore/add/remove/force - -# (Pawn) Whether to change optional semicolons to real semicolons. -mod_pawn_semicolon = false # true/false - -# Whether to fully parenthesize Boolean expressions in 'while' and 'if' -# statement, as in 'if (a && b > c)' => 'if (a && (b > c))'. -mod_full_paren_if_bool = false # true/false - -# Whether to remove superfluous semicolons. -mod_remove_extra_semicolon = false # true/false - -# If a function body exceeds the specified number of newlines and doesn't have -# a comment after the close brace, a comment will be added. -mod_add_long_function_closebrace_comment = 0 # unsigned number - -# If a namespace body exceeds the specified number of newlines and doesn't -# have a comment after the close brace, a comment will be added. -mod_add_long_namespace_closebrace_comment = 0 # unsigned number - -# If a class body exceeds the specified number of newlines and doesn't have a -# comment after the close brace, a comment will be added. -mod_add_long_class_closebrace_comment = 0 # unsigned number - -# If a switch body exceeds the specified number of newlines and doesn't have a -# comment after the close brace, a comment will be added. -mod_add_long_switch_closebrace_comment = 0 # unsigned number - -# If an #ifdef body exceeds the specified number of newlines and doesn't have -# a comment after the #endif, a comment will be added. -mod_add_long_ifdef_endif_comment = 0 # unsigned number - -# If an #ifdef or #else body exceeds the specified number of newlines and -# doesn't have a comment after the #else, a comment will be added. -mod_add_long_ifdef_else_comment = 0 # unsigned number - -# Whether to take care of the case by the mod_sort_xx options. -mod_sort_case_sensitive = false # true/false - -# Whether to sort consecutive single-line 'import' statements. -mod_sort_import = false # true/false - -# (C#) Whether to sort consecutive single-line 'using' statements. -mod_sort_using = false # true/false - -# Whether to sort consecutive single-line '#include' statements (C/C++) and -# '#import' statements (Objective-C). Be aware that this has the potential to -# break your code if your includes/imports have ordering dependencies. -mod_sort_include = false # true/false - -# Whether to prioritize '#include' and '#import' statements that contain -# filename without extension when sorting is enabled. -mod_sort_incl_import_prioritize_filename = false # true/false - -# Whether to prioritize '#include' and '#import' statements that does not -# contain extensions when sorting is enabled. -mod_sort_incl_import_prioritize_extensionless = false # true/false - -# Whether to prioritize '#include' and '#import' statements that contain -# angle over quotes when sorting is enabled. -mod_sort_incl_import_prioritize_angle_over_quotes = false # true/false - -# Whether to ignore file extension in '#include' and '#import' statements -# for sorting comparison. -mod_sort_incl_import_ignore_extension = false # true/false - -# Whether to group '#include' and '#import' statements when sorting is enabled. -mod_sort_incl_import_grouping_enabled = false # true/false - -# Whether to move a 'break' that appears after a fully braced 'case' before -# the close brace, as in 'case X: { ... } break;' => 'case X: { ... break; }'. -mod_move_case_break = false # true/false - -# Add or remove braces around a fully braced case statement. Will only remove -# braces if there are no variable declarations in the block. -mod_case_brace = ignore # ignore/add/remove/force - -# Whether to remove a void 'return;' that appears as the last statement in a -# function. -mod_remove_empty_return = false # true/false - -# Add or remove the comma after the last value of an enumeration. -mod_enum_last_comma = ignore # ignore/add/remove/force - -# (OC) Whether to organize the properties. If true, properties will be -# rearranged according to the mod_sort_oc_property_*_weight factors. -mod_sort_oc_properties = false # true/false - -# (OC) Weight of a class property modifier. -mod_sort_oc_property_class_weight = 0 # number - -# (OC) Weight of 'atomic' and 'nonatomic'. -mod_sort_oc_property_thread_safe_weight = 0 # number - -# (OC) Weight of 'readwrite' when organizing properties. -mod_sort_oc_property_readwrite_weight = 0 # number - -# (OC) Weight of a reference type specifier ('retain', 'copy', 'assign', -# 'weak', 'strong') when organizing properties. -mod_sort_oc_property_reference_weight = 0 # number - -# (OC) Weight of getter type ('getter=') when organizing properties. -mod_sort_oc_property_getter_weight = 0 # number - -# (OC) Weight of setter type ('setter=') when organizing properties. -mod_sort_oc_property_setter_weight = 0 # number - -# (OC) Weight of nullability type ('nullable', 'nonnull', 'null_unspecified', -# 'null_resettable') when organizing properties. -mod_sort_oc_property_nullability_weight = 0 # number - -# -# Preprocessor options -# - -# Add or remove indentation of preprocessor directives inside #if blocks -# at brace level 0 (file-level). -pp_indent = ignore # ignore/add/remove/force - -# Whether to indent #if/#else/#endif at the brace level. If false, these are -# indented from column 1. -pp_indent_at_level = false # true/false - -# Specifies the number of columns to indent preprocessors per level -# at brace level 0 (file-level). If pp_indent_at_level=false, also specifies -# the number of columns to indent preprocessors per level -# at brace level > 0 (function-level). -# -# Default: 1 -pp_indent_count = 1 # unsigned number - -# Add or remove space after # based on pp_level of #if blocks. -pp_space = ignore # ignore/add/remove/force - -# Sets the number of spaces per level added with pp_space. -pp_space_count = 0 # unsigned number - -# The indent for '#region' and '#endregion' in C# and '#pragma region' in -# C/C++. Negative values decrease indent down to the first column. -pp_indent_region = 0 # number - -# Whether to indent the code between #region and #endregion. -pp_region_indent_code = false # true/false - -# If pp_indent_at_level=true, sets the indent for #if, #else and #endif when -# not at file-level. Negative values decrease indent down to the first column. -# -# =0: Indent preprocessors using output_tab_size -# >0: Column at which all preprocessors will be indented -pp_indent_if = 0 # number - -# Whether to indent the code between #if, #else and #endif. -pp_if_indent_code = false # true/false - -# Whether to indent '#define' at the brace level. If false, these are -# indented from column 1. -pp_define_at_level = false # true/false - -# Whether to ignore the '#define' body while formatting. -pp_ignore_define_body = false # true/false - -# Whether to indent case statements between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the case statements -# directly inside of. -# -# Default: true -pp_indent_case = true # true/false - -# Whether to indent whole function definitions between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the function definition -# is directly inside of. -# -# Default: true -pp_indent_func_def = true # true/false - -# Whether to indent extern C blocks between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the extern block is -# directly inside of. -# -# Default: true -pp_indent_extern = true # true/false - -# Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly -# inside of. -# -# Default: true -pp_indent_brace = true # true/false - -# -# Sort includes options -# - -# The regex for include category with priority 0. -include_category_0 = "" # string - -# The regex for include category with priority 1. -include_category_1 = "" # string - -# The regex for include category with priority 2. -include_category_2 = "" # string - -# -# Use or Do not Use options -# - -# true: indent_func_call_param will be used (default) -# false: indent_func_call_param will NOT be used -# -# Default: true -use_indent_func_call_param = true # true/false - -# The value of the indentation for a continuation line is calculated -# differently if the statement is: -# - a declaration: your case with QString fileName ... -# - an assignment: your case with pSettings = new QSettings( ... -# -# At the second case the indentation value might be used twice: -# - at the assignment -# - at the function call (if present) -# -# To prevent the double use of the indentation value, use this option with the -# value 'true'. -# -# true: indent_continue will be used only once -# false: indent_continue will be used every time (default) -use_indent_continue_only_once = false # true/false - -# The value might be used twice: -# - at the assignment -# - at the opening brace -# -# To prevent the double use of the indentation value, use this option with the -# value 'true'. -# -# true: indentation will be used only once -# false: indentation will be used every time (default) -indent_cpp_lambda_only_once = false # true/false - -# Whether sp_after_angle takes precedence over sp_inside_fparen. This was the -# historic behavior, but is probably not the desired behavior, so this is off -# by default. -use_sp_after_angle_always = false # true/false - -# Whether to apply special formatting for Qt SIGNAL/SLOT macros. Essentially, -# this tries to format these so that they match Qt's normalized form (i.e. the -# result of QMetaObject::normalizedSignature), which can slightly improve the -# performance of the QObject::connect call, rather than how they would -# otherwise be formatted. -# -# See options_for_QT.cpp for details. -# -# Default: true -use_options_overriding_for_qt_macros = true # true/false - -# If true: the form feed character is removed from the list -# of whitespace characters. -# See https://en.cppreference.com/w/cpp/string/byte/isspace -use_form_feed_no_more_as_whitespace_character = false # true/false - -# -# Warn levels - 1: error, 2: warning (default), 3: note -# - -# (C#) Warning is given if doing tab-to-\t replacement and we have found one -# in a C# verbatim string literal. -# -# Default: 2 -warn_level_tabs_found_in_verbatim_string_literals = 2 # unsigned number - -# Limit the number of loops. -# Used by uncrustify.cpp to exit from infinite loop. -# 0: no limit. -debug_max_number_of_loops = 0 # number - -# Set the number of the line to protocol; -# Used in the function prot_the_line if the 2. parameter is zero. -# 0: nothing protocol. -debug_line_number_to_protocol = 0 # number - -# Set the number of second(s) before terminating formatting the current file, -# 0: no timeout. -# only for linux -debug_timeout = 0 # number - -# Meaning of the settings: -# Ignore - do not do any changes -# Add - makes sure there is 1 or more space/brace/newline/etc -# Force - makes sure there is exactly 1 space/brace/newline/etc, -# behaves like Add in some contexts -# Remove - removes space/brace/newline/etc -# -# -# - Token(s) can be treated as specific type(s) with the 'set' option: -# `set tokenType tokenString [tokenString...]` -# -# Example: -# `set BOOL __AND__ __OR__` -# -# tokenTypes are defined in src/token_enum.h, use them without the -# 'CT_' prefix: 'CT_BOOL' => 'BOOL' -# -# -# - Token(s) can be treated as type(s) with the 'type' option. -# `type tokenString [tokenString...]` -# -# Example: -# `type int c_uint_8 Rectangle` -# -# This can also be achieved with `set TYPE int c_uint_8 Rectangle` -# -# -# To embed whitespace in tokenStrings use the '\' escape character, or quote -# the tokenStrings. These quotes are supported: "'` -# -# -# - Support for the auto detection of languages through the file ending can be -# added using the 'file_ext' command. -# `file_ext langType langString [langString..]` -# -# Example: -# `file_ext CPP .ch .cxx .cpp.in` -# -# langTypes are defined in uncrusify_types.h in the lang_flag_e enum, use -# them without the 'LANG_' prefix: 'LANG_CPP' => 'CPP' -# -# -# - Custom macro-based indentation can be set up using 'macro-open', -# 'macro-else' and 'macro-close'. -# `(macro-open | macro-else | macro-close) tokenString` -# -# Example: -# `macro-open BEGIN_TEMPLATE_MESSAGE_MAP` -# `macro-open BEGIN_MESSAGE_MAP` -# `macro-close END_MESSAGE_MAP` -# -# -# option(s) with 'not default' value: 0 -# From 286efc18fc4f207b1a1a4539ee5030a45952c050 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 30 Nov 2022 09:29:05 -0600 Subject: [PATCH 173/357] handle domain with trailing dot Closes: #7032 --- ports/espressif/common-hal/socketpool/SocketPool.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ports/espressif/common-hal/socketpool/SocketPool.c b/ports/espressif/common-hal/socketpool/SocketPool.c index 1d1aafa638..780e90c42c 100644 --- a/ports/espressif/common-hal/socketpool/SocketPool.c +++ b/ports/espressif/common-hal/socketpool/SocketPool.c @@ -45,6 +45,16 @@ void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t *sel mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t *self, const char *host) { + // As of 2022, the version of lwip in esp-idf does not handle the + // trailing-dot syntax of domain names, so emulate it. + // Remove this once https://github.com/espressif/esp-idf/issues/10013 has + // been implemented + size_t strlen_host = strlen(host); + if (strlen_host && host[strlen_host - 1] == '.') { + mp_obj_t nodot = mp_obj_new_str(host, strlen_host - 1); + host = mp_obj_str_get_str(nodot); + } + const struct addrinfo hints = { .ai_family = AF_INET, .ai_socktype = SOCK_STREAM, From 7c336c51a8c920c1d241bd93a70eb081be378f0b Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 29 Nov 2022 15:40:51 +0000 Subject: [PATCH 174/357] Translated using Weblate (Swedish) Currently translated at 100.0% (996 of 996 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 20e22166cd..57e2b2e594 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-11-11 18:49+0000\n" +"PO-Revision-Date: 2022-11-30 16:14+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1693,7 +1693,7 @@ msgstr "Åtgärden orsakade timeout" #: ports/raspberrypi/common-hal/mdns/Server.c msgid "Out of MDNS service slots" -msgstr "" +msgstr "Slut på MDNS-serviceplatser" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" From 1711cce52bd03753a306c58f5c323abd30de14ce Mon Sep 17 00:00:00 2001 From: hexthat Date: Tue, 29 Nov 2022 22:54:15 +0000 Subject: [PATCH 175/357] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (996 of 996 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index ac9d28d5fc..88d106bfca 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-11-19 18:48+0000\n" +"PO-Revision-Date: 2022-11-30 16:14+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -1700,7 +1700,7 @@ msgstr "cāo zuò yǐ fēn shí" #: ports/raspberrypi/common-hal/mdns/Server.c msgid "Out of MDNS service slots" -msgstr "" +msgstr "chāo chū MDNS fú wù chā cáo" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" From eb1913576e208bfd94ede25298c9caab1709a018 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 30 Nov 2022 17:14:26 +0100 Subject: [PATCH 176/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 14 +++++++++----- locale/cs.po | 14 +++++++++----- locale/de_DE.po | 17 ++++++++++++----- locale/el.po | 14 +++++++++----- locale/en_GB.po | 17 ++++++++++++----- locale/es.po | 14 +++++++++----- locale/fil.po | 14 +++++++++----- locale/fr.po | 17 ++++++++++++----- locale/hi.po | 14 +++++++++----- locale/it_IT.po | 14 +++++++++----- locale/ja.po | 14 +++++++++----- locale/ko.po | 14 +++++++++----- locale/nl.po | 14 +++++++++----- locale/pl.po | 14 +++++++++----- locale/pt_BR.po | 17 ++++++++++++----- locale/ru.po | 14 +++++++++----- locale/sv.po | 17 ++++++++++++----- locale/tr.po | 14 +++++++++----- locale/zh_Latn_pinyin.po | 17 ++++++++++++----- 19 files changed, 189 insertions(+), 95 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 5ac957eb07..0bf1cf9323 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -181,7 +181,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "%q harus bertipe %q" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -907,6 +907,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Mode kendara tidak digunakan saat arah input." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB hanya beroperasi pada 16 byte di satu waktu" @@ -2040,6 +2044,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3372,10 +3380,6 @@ msgstr "" msgid "invalid syntax for number" msgstr "" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 55a1787aa7..952c7dca61 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -182,7 +182,7 @@ msgstr "%q musí být int" msgid "%q must be of type %q" msgstr "%q musí být typu %q" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q musí být typu %q nebo None" @@ -905,6 +905,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB operuje najednou pouze 16 bajtů" @@ -2029,6 +2033,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3359,10 +3367,6 @@ msgstr "" msgid "invalid syntax for number" msgstr "" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 127a1c4ac7..79ab102d09 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -184,7 +184,7 @@ msgstr "%q muss vom Typ Integer sein" msgid "%q must be of type %q" msgstr "%q muss vom Type %q sein" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q muss vom Type %q oder None sein" @@ -913,6 +913,10 @@ msgstr "Fertig" msgid "Drive mode not used when direction is input." msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" @@ -2058,6 +2062,10 @@ msgstr "" "Das Modul `microcontroller` wurde zum Booten in den abgesicherten Modus " "verwendet. Drücke Reset, um den abgesicherten Modus zu verlassen." +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "Beim Starten wurde die zentrale Taste gedrückt.\n" @@ -3430,10 +3438,6 @@ msgstr "ungültige Syntax für integer mit Basis %d" msgid "invalid syntax for number" msgstr "ungültige Syntax für number" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "ungültiger Traceback" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 muss eine Klasse sein" @@ -4442,6 +4446,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 "invalid traceback" +#~ msgstr "ungültiger Traceback" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q Indizes müssen Integer sein, nicht %s" diff --git a/locale/el.po b/locale/el.po index 4a6b5c4250..98b2e191aa 100644 --- a/locale/el.po +++ b/locale/el.po @@ -187,7 +187,7 @@ msgstr "%q πρέπει να είναι int" msgid "%q must be of type %q" msgstr "%q πρέπει να είναι τύπου %q" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q πρέπει να είναι τύπου %q ή None" @@ -919,6 +919,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "" @@ -2038,6 +2042,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3368,10 +3376,6 @@ msgstr "" msgid "invalid syntax for number" msgstr "" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 15d3644f52..d6c8f96d6e 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -185,7 +185,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -908,6 +908,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Drive mode not used when direction is input." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB only operates on 16 bytes at a time" @@ -2039,6 +2043,10 @@ msgstr "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3378,10 +3386,6 @@ msgstr "invalid syntax for integer with base %d" msgid "invalid syntax for number" msgstr "invalid syntax for number" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "invalid traceback" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 must be a class" @@ -4377,6 +4381,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 "invalid traceback" +#~ msgstr "invalid traceback" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q indices must be integers, not %s" diff --git a/locale/es.po b/locale/es.po index bb1c36b9bf..4111331bba 100644 --- a/locale/es.po +++ b/locale/es.po @@ -187,7 +187,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -918,6 +918,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Modo Drive no se usa cuando la dirección es input." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB solo opera sobre 16 bytes a la vez" @@ -2068,6 +2072,10 @@ msgstr "" "El módulo de `microcontroller` se usó para un arranque en modo seguro. " "Presione reset para salir del modo seguro." +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3418,10 +3426,6 @@ msgstr "sintaxis inválida para entero con base %d" msgid "invalid syntax for number" msgstr "sintaxis inválida para número" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 debe ser una clase" diff --git a/locale/fil.po b/locale/fil.po index 2cf6e49da4..b9a0f3e0fb 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -176,7 +176,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -904,6 +904,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "" @@ -2028,6 +2032,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3372,10 +3380,6 @@ msgstr "maling sintaks sa integer na may base %d" msgid "invalid syntax for number" msgstr "maling sintaks sa number" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 ay dapat na class" diff --git a/locale/fr.po b/locale/fr.po index 9f6bfba96b..b44afd090f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -187,7 +187,7 @@ msgstr "%q doit être un entier" msgid "%q must be of type %q" msgstr "%q doit être du type %q" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q doit être du type %q ou None" @@ -928,6 +928,10 @@ msgid "Drive mode not used when direction is input." msgstr "" "Le mode Drive n'est pas utilisé quand la direction est entrante ('input')." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "La BCE ne fonctionne que sur 16 octets à la fois" @@ -2088,6 +2092,10 @@ msgstr "" "Le module `microcontroller` a été utilisé pour démarrer en mode sûr. Pressez " "reset pour quitter le mode sûr." +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "Le bouton central était pressé au démarrage.\n" @@ -3460,10 +3468,6 @@ msgstr "syntaxe invalide pour un entier de base %d" msgid "invalid syntax for number" msgstr "syntaxe invalide pour un nombre" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "traceback invalide" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "l'argument 1 de issubclass() doit être une classe" @@ -4470,6 +4474,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 "invalid traceback" +#~ msgstr "traceback invalide" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "les indices %q doivent être des entiers, pas %s" diff --git a/locale/hi.po b/locale/hi.po index ec884b211e..3442078b84 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -175,7 +175,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -894,6 +894,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "" @@ -2011,6 +2015,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3341,10 +3349,6 @@ msgstr "" msgid "invalid syntax for number" msgstr "" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 60698f4d36..0096ffdb40 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -182,7 +182,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -909,6 +909,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "" @@ -2038,6 +2042,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3380,10 +3388,6 @@ msgstr "sintassi invalida per l'intero con base %d" msgid "invalid syntax for number" msgstr "sintassi invalida per il numero" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "il primo argomento di issubclass() deve essere una classe" diff --git a/locale/ja.po b/locale/ja.po index cc48e83b25..226f0d33a1 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -180,7 +180,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -903,6 +903,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "方向がinputのときドライブモードは使われません" +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECBは一度に16バイトの演算のみを行います" @@ -2024,6 +2028,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3360,10 +3368,6 @@ msgstr "" msgid "invalid syntax for number" msgstr "数字として不正な構文" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass()の第1引数はクラスでなければなりません" diff --git a/locale/ko.po b/locale/ko.po index e1609990db..9f192a7a50 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -176,7 +176,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -897,6 +897,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "" @@ -2014,6 +2018,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3345,10 +3353,6 @@ msgstr "구문(syntax)가 정수가 유효하지 않습니다" msgid "invalid syntax for number" msgstr "숫자에 대한 구문(syntax)가 유효하지 않습니다" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index e002370151..8fb7799231 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -178,7 +178,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -902,6 +902,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Drive modus niet gebruikt als de richting input is." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB werkt alleen met 16 bytes tegelijkertijd" @@ -2035,6 +2039,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3375,10 +3383,6 @@ msgstr "ongeldige syntax voor integer met grondtal %d" msgid "invalid syntax for number" msgstr "ongeldige syntax voor nummer" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() argument 1 moet een klasse zijn" diff --git a/locale/pl.po b/locale/pl.po index d025272b69..7d7085a2c0 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -180,7 +180,7 @@ msgstr "" msgid "%q must be of type %q" msgstr "" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "" @@ -903,6 +903,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Tryb sterowania nieużywany w trybie wejścia." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB działa tylko na 16 bajtach naraz" @@ -2022,6 +2026,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3353,10 +3361,6 @@ msgstr "zła składnia dla liczby całkowitej w bazie %d" msgid "invalid syntax for number" msgstr "zła składnia dla liczby" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "argument 1 dla issubclass() musi być klasą" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e8a71e3d5b..979b7c632a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -184,7 +184,7 @@ msgstr "%q deve ser um inteiro" msgid "%q must be of type %q" msgstr "%q deve ser do tipo %q" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q deve ser do tipo %q ou nenhum" @@ -921,6 +921,10 @@ msgstr "Feito" msgid "Drive mode not used when direction is input." msgstr "O modo do controlador não é usado quando a direção for inserida." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "O BCE opera apenas com 16 bytes por vez" @@ -2072,6 +2076,10 @@ msgstr "" "O módulo `microcontrolador` foi utilizado para iniciar em modo seguro. " "Pressione reset para encerrar do modo de segurança." +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "O botão central foi pressionado na inicialização.\n" @@ -3436,10 +3444,6 @@ msgstr "sintaxe inválida para o número inteiro com base %d" msgid "invalid syntax for number" msgstr "sintaxe inválida para o número" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "rastreamento inválido" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 deve ser uma classe" @@ -4445,6 +4449,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 "invalid traceback" +#~ msgstr "rastreamento inválido" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "Os índices %q devem ser inteiros, e não %s" diff --git a/locale/ru.po b/locale/ru.po index 2bfe2cdece..82b2965ead 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -186,7 +186,7 @@ msgstr "%q должно быть int" msgid "%q must be of type %q" msgstr "%q должно быть типа %q" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q должно быть типа %q или None" @@ -925,6 +925,10 @@ msgstr "Выполнено" msgid "Drive mode not used when direction is input." msgstr "Drive mode не используется, когда направление является входным." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB работает только с 16 байтами за раз" @@ -2077,6 +2081,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3409,10 +3417,6 @@ msgstr "" msgid "invalid syntax for number" msgstr "" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 57e2b2e594..98f0624ca1 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -185,7 +185,7 @@ msgstr "%q måste vara en int" msgid "%q must be of type %q" msgstr "%q måste vara av typen %q" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q måste vara av typen %q eller None" @@ -910,6 +910,10 @@ msgstr "Klar" msgid "Drive mode not used when direction is input." msgstr "Drivläge används inte när riktning är input." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB arbetar endast på 16 byte åt gången" @@ -2050,6 +2054,10 @@ msgstr "" "Modulen `microcontroller` användes för att starta upp i felsäkert läge. " "Tryck på reset för att avsluta felsäkert läget." +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "Mittknappen trycktes in vid start.\n" @@ -3403,10 +3411,6 @@ msgstr "ogiltig syntax för heltal med bas %d" msgid "invalid syntax for number" msgstr "ogiltig syntax för tal" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "Ogilitig källspårning" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 måste vara en klass" @@ -4406,6 +4410,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 "invalid traceback" +#~ msgstr "Ogilitig källspårning" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "Indexet %q måste vara ett heltal, inte %s" diff --git a/locale/tr.po b/locale/tr.po index 09705c507e..858e0ba4b3 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -187,7 +187,7 @@ msgstr "%q bir tam sayı olmalıdır" msgid "%q must be of type %q" msgstr "%q, %q türünde olmalıdır" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q, %q ya da None türünde olmalıdır" @@ -911,6 +911,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "" @@ -2031,6 +2035,10 @@ msgid "" "exit safe mode." msgstr "" +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "" @@ -3361,10 +3369,6 @@ msgstr "" msgid "invalid syntax for number" msgstr "" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 88d106bfca..daa7721926 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -187,7 +187,7 @@ msgstr "%q bìxū shì zhěng xíng" msgid "%q must be of type %q" msgstr "%q bì xū shì %q lèi xíng" -#: shared-bindings/digitalio/Pull.c +#: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" msgstr "%q lèi xíng bì xū wéi %q huò wú" @@ -912,6 +912,10 @@ msgstr "zuò" msgid "Drive mode not used when direction is input." msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." +#: py/obj.c +msgid "During handling of the above exception, another exception occurred:" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" msgstr "ECB yí cì zhǐ shǐ yòng 16 gè zì jié" @@ -2055,6 +2059,10 @@ msgstr "" "`wēi kòng zhì qì` mó kuài yòng yú qǐ dòng dào ān quán mó shì. àn chóng zhì " "tuì chū ān quán mó shì." +#: py/obj.c +msgid "The above exception was the direct cause of the following exception:" +msgstr "" + #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" msgstr "qǐ dòng shí àn xià zhōng yāng àn niǔ.\n" @@ -3410,10 +3418,6 @@ msgstr "jīshù wèi %d de zhěng shǔ de yǔfǎ wúxiào" msgid "invalid syntax for number" msgstr "wúxiào de hàomǎ yǔfǎ" -#: py/objexcept.c -msgid "invalid traceback" -msgstr "wú xiào zhuī sù" - #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() cānshù 1 bìxū shì yīgè lèi" @@ -4413,6 +4417,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 "invalid traceback" +#~ msgstr "wú xiào zhuī sù" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" From 44d5326d4cbc21d93649b7221ee7c8444e6e8f1b Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 30 Nov 2022 19:36:00 +0200 Subject: [PATCH 177/357] fix picow-ap --- ports/raspberrypi/common-hal/wifi/Radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index fcedcb2ce2..0459841b47 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -162,7 +162,7 @@ void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) { bindings_cyw43_wifi_enforce_pm(); } -void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections) { +void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint32_t authmodes, uint8_t max_connections) { if (!common_hal_wifi_radio_get_enabled(self)) { mp_raise_RuntimeError(translate("Wifi is not enabled")); } From e489b73d88fa38e6d4ddff6d6537db120010aee1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 30 Nov 2022 12:04:47 -0600 Subject: [PATCH 178/357] update esp-idf to merge commit --- ports/espressif/esp-idf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index dbb2d88eb8..26716e006d 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit dbb2d88eb8a90a314d6f2e7b0af71925802c552e +Subproject commit 26716e006d68e5a584ac29b85d9e2979563fc827 From 10d92873c38211db27aa58dd1114298994543f7d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 11:21:03 -0600 Subject: [PATCH 179/357] Don't generate QSTRs for wrong identifiers MP_REGISTER_MODULE would use identifiers like "MODULE_DEF_MP_QSTR___FUTURE__" which would in turn cause a QSTR to be generated for it. This wasn't desirable, because the qstr would never be used. This clears out quite a bit of flash storage on the proxlight trinkey. --- py/genlast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/genlast.py b/py/genlast.py index ad44745d97..460271af81 100644 --- a/py/genlast.py +++ b/py/genlast.py @@ -12,7 +12,7 @@ import subprocess from makeqstrdefs import qstr_unescape, QSTRING_BLOCK_LIST re_line = re.compile(r"#[line]*\s(\d+)\s\"([^\"]+)\"", re.DOTALL) -re_qstr = re.compile(r"MP_QSTR_[_a-zA-Z0-9]+", re.DOTALL) +re_qstr = re.compile(r"\bMP_QSTR_[_a-zA-Z0-9]+", re.DOTALL) re_translate = re.compile(r"translate\(\"((?:(?=(\\?))\2.)*?)\"\)", re.DOTALL) From 2315b62bff5ada6dfdfa6a9662266ef2451a9294 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 11:21:22 -0600 Subject: [PATCH 180/357] Remove unused static qstrs These are turned into TRANSLATE() messages now, so the qstr version would not be used. --- py/qstrdefs.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 02b87f4ec3..70753866bd 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -49,7 +49,6 @@ Q({:#x}) Q({:#b}) Q( ) Q(\n) -Q(maximum recursion depth exceeded) Q() Q() Q() @@ -63,7 +62,3 @@ Q(utf-8) #if MICROPY_MODULE_FROZEN Q(.frozen) #endif - -#if MICROPY_ENABLE_PYSTACK -Q(pystack exhausted) -#endif From 284ac21f512ed06137662833c1c30e2f7e4631cb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 14:34:44 -0600 Subject: [PATCH 181/357] merge a message --- shared-bindings/busio/I2C.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 71ac0e3995..3dd645b256 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -345,7 +345,7 @@ STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *p const int32_t in_end = args[ARG_in_end].u_int; normalize_buffer_bounds(&in_start, in_end, &in_length); if (in_length == 0) { - mp_raise_ValueError_varg(translate("%q length must be >= 1"), MP_QSTR_out_buffer); + mp_raise_ValueError_varg(translate("%q length must be >= %d"), MP_QSTR_out_buffer, 1); } uint8_t status = common_hal_busio_i2c_write_read(self, args[ARG_address].u_int, From 6ac2022093bc627b7bb61c336aa5f683406841ea Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 14:36:35 -0600 Subject: [PATCH 182/357] merge a message --- shared-bindings/usb_hid/Device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 97196144be..cb88766b3e 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -155,7 +155,7 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args } if (report_ids_array[0] == 0 && report_ids_count > 1) { - mp_raise_ValueError_varg(translate("%q with a report ID of 0 must be of length 1"), MP_QSTR_report_ids); + mp_raise_ValueError_varg(translate("%q length must be %d"), MP_QSTR_report_id_space_0, 1); } common_hal_usb_hid_device_construct( From f652a898e78d0a6f0fe7963c86891771d09652df Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 14:37:32 -0600 Subject: [PATCH 183/357] merge two messages --- py/argcheck.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/argcheck.c b/py/argcheck.c index c28c577088..9ec21d4898 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -239,7 +239,7 @@ mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_ mp_obj_t mp_arg_validate_type_string(mp_obj_t obj, qstr arg_name) { if (!mp_obj_is_str(obj)) { - mp_raise_TypeError_varg(translate("%q must be a string"), arg_name); + mp_raise_TypeError_varg(translate("%q must be of type %q"), arg_name, MP_QSTR_str); } return obj; } @@ -247,7 +247,7 @@ mp_obj_t mp_arg_validate_type_string(mp_obj_t obj, qstr arg_name) { mp_int_t mp_arg_validate_type_int(mp_obj_t obj, qstr arg_name) { mp_int_t an_int; if (!mp_obj_get_int_maybe(obj, &an_int)) { - mp_raise_TypeError_varg(translate("%q must be an int"), arg_name); + mp_raise_TypeError_varg(translate("%q must be of type %q"), arg_name, MP_QSTR_int); } return an_int; } From 7df21c9ecfd2335b004825b999752853cf2fb3f0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 14:44:08 -0600 Subject: [PATCH 184/357] Combine a message --- py/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/runtime.c b/py/runtime.c index e5b411b0d3..e3750b7448 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -310,7 +310,7 @@ mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) { } #else if (op == MP_UNARY_OP_INT) { - mp_raise_TypeError_varg(MP_ERROR_TEXT("can't convert %q to int"), mp_obj_get_type_qstr(arg)); + mp_raise_TypeError_varg(MP_ERROR_TEXT("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_int); } else { mp_raise_TypeError_varg(MP_ERROR_TEXT("unsupported type for %q: '%q'"), mp_unary_op_method_name[op], mp_obj_get_type_qstr(arg)); From ac999098ee4c9aee39f017bb50146bda419f3d96 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 14:49:01 -0600 Subject: [PATCH 185/357] merge a message --- shared-bindings/time/__init__.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 096c80d382..d02923f162 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -97,9 +97,7 @@ STATIC mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, s size_t len; mp_obj_t *items; mp_obj_get_array(args[0], &len, &items); - if (len != 9) { - mp_raise_TypeError(translate("time.struct_time() takes a 9-sequence")); - } + mp_arg_validate_length(len, 9, MP_QSTR_value); return namedtuple_make_new(type, len, 0, items); } From 8658e7a9546647521a281ac22e473bf688763d0e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 14:55:45 -0600 Subject: [PATCH 186/357] re-use length validator --- shared-bindings/microcontroller/Pin.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 42076aa90e..f1b9a90d45 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -156,9 +156,7 @@ void validate_no_duplicate_pins_2(mp_obj_t seq1, mp_obj_t seq2, qstr arg_name1, // Validate every element in the list to be a free pin. void validate_list_is_free_pins(qstr what, const mcu_pin_obj_t **pins_out, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out) { mp_int_t len = MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq)); - if (len > max_pins) { - mp_raise_ValueError_varg(translate("At most %d %q may be specified (not %d)"), max_pins, what, len); - } + mp_arg_validate_length_max(len, max_pins, what); *count_out = len; for (mp_int_t i = 0; i < len; i++) { pins_out[i] = validate_obj_is_free_pin(mp_obj_subscr(seq, MP_OBJ_NEW_SMALL_INT(i), MP_OBJ_SENTINEL)); From 7c9cd567a0780448b3b29e9666e3cd9dbc50161f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 14:58:59 -0600 Subject: [PATCH 187/357] If uart is disabled, no pins will work; show NotImplementedError instead --- shared-bindings/busio/UART.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index eb1d1685a5..59e46cafc4 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -155,7 +155,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si args[ARG_receiver_buffer_size].u_int, NULL, false); return (mp_obj_t)self; #else - mp_raise_ValueError(translate("Invalid pins")); + mp_raise_NotImplementedError(NULL); #endif // CIRCUITPY_BUSIO_UART } From beb053a94d742d8829e2b77ca8f9b06a7bf7a186 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 14:59:57 -0600 Subject: [PATCH 188/357] more thoroughly disable UART when --- ports/atmel-samd/common-hal/busio/UART.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 3a9b628e0b..6027b6a5fa 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#if CIRCUITPY_BUSIO_UART #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/busio/UART.h" @@ -485,3 +486,4 @@ bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { usart_async_get_status(usart_desc_p, &async_status); return !(async_status.flags & USART_ASYNC_STATUS_BUSY); } +#endif From db01dfea2046d29c66acaf709dfaf14129a5fc87 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:03:22 -0600 Subject: [PATCH 189/357] use a standard length validator --- shared-module/usb_hid/__init__.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared-module/usb_hid/__init__.c b/shared-module/usb_hid/__init__.c index 99be84542f..11b87a78f1 100644 --- a/shared-module/usb_hid/__init__.c +++ b/shared-module/usb_hid/__init__.c @@ -220,9 +220,7 @@ bool common_hal_usb_hid_enable(const mp_obj_t devices, uint8_t boot_device) { } const mp_int_t num_devices = MP_OBJ_SMALL_INT_VALUE(mp_obj_len(devices)); - if (num_devices > MAX_HID_DEVICES) { - mp_raise_ValueError_varg(translate("No more than %d HID devices allowed"), MAX_HID_DEVICES); - } + mp_arg_validate_length_max(num_devices, MAX_HID_DEVICES, MP_QSTR_devices); num_hid_devices = num_devices; From 2b01c139f5df6f0c58c302143c7857aca968baf8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:05:33 -0600 Subject: [PATCH 190/357] use a standard validator function --- shared-bindings/adafruit_pixelbuf/PixelBuf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared-bindings/adafruit_pixelbuf/PixelBuf.c b/shared-bindings/adafruit_pixelbuf/PixelBuf.c index 6203f672ad..2252b7d59e 100644 --- a/shared-bindings/adafruit_pixelbuf/PixelBuf.c +++ b/shared-bindings/adafruit_pixelbuf/PixelBuf.c @@ -129,9 +129,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_a } static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t *parsed) { - if (!mp_obj_is_str(byteorder_obj)) { - mp_raise_TypeError(translate("byteorder is not a string")); - } + mp_arg_validate_type_string(byteorder_obj, MP_QSTR_byteorder); size_t bo_len; const char *byteorder = mp_obj_str_get_data(byteorder_obj, &bo_len); From d904d8e9a0f943ac10aa0360b36ecd01de8e953f Mon Sep 17 00:00:00 2001 From: m1cha1s Date: Wed, 30 Nov 2022 20:26:41 +0100 Subject: [PATCH 191/357] Renamed the board folder to doit_esp32_devkit_v1 --- .../boards/doit_esp32_devkit_v1/board.c | 29 ++++++++++++ .../doit_esp32_devkit_v1/mpconfigboard.h | 45 ++++++++++++++++++ .../doit_esp32_devkit_v1/mpconfigboard.mk | 9 ++++ .../boards/doit_esp32_devkit_v1/pins.c | 46 +++++++++++++++++++ .../boards/doit_esp32_devkit_v1/sdkconfig | 20 ++++++++ 5 files changed, 149 insertions(+) create mode 100644 ports/espressif/boards/doit_esp32_devkit_v1/board.c create mode 100644 ports/espressif/boards/doit_esp32_devkit_v1/mpconfigboard.h create mode 100644 ports/espressif/boards/doit_esp32_devkit_v1/mpconfigboard.mk create mode 100644 ports/espressif/boards/doit_esp32_devkit_v1/pins.c create mode 100644 ports/espressif/boards/doit_esp32_devkit_v1/sdkconfig diff --git a/ports/espressif/boards/doit_esp32_devkit_v1/board.c b/ports/espressif/boards/doit_esp32_devkit_v1/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/doit_esp32_devkit_v1/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/doit_esp32_devkit_v1/mpconfigboard.h b/ports/espressif/boards/doit_esp32_devkit_v1/mpconfigboard.h new file mode 100644 index 0000000000..2a0dcd0104 --- /dev/null +++ b/ports/espressif/boards/doit_esp32_devkit_v1/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert 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 "ESP32 Devkit V1" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO22, .sda = &pin_GPIO21}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO17, .rx = &pin_GPIO16}} + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/doit_esp32_devkit_v1/mpconfigboard.mk b/ports/espressif/boards/doit_esp32_devkit_v1/mpconfigboard.mk new file mode 100644 index 0000000000..7aa352e16e --- /dev/null +++ b/ports/espressif/boards/doit_esp32_devkit_v1/mpconfigboard.mk @@ -0,0 +1,9 @@ +CIRCUITPY_CREATOR_ID = 0xB0D00000 +CIRCUITPY_CREATION_ID = 0x00320002 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/doit_esp32_devkit_v1/pins.c b/ports/espressif/boards/doit_esp32_devkit_v1/pins.c new file mode 100644 index 0000000000..78c37897ac --- /dev/null +++ b/ports/espressif/boards/doit_esp32_devkit_v1/pins.c @@ -0,0 +1,46 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, left side, then right side + {MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15)}, + {MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2)}, + {MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO16)}, + {MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO17)}, + {MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5)}, + {MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18)}, + {MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19)}, + {MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21)}, + {MP_ROM_QSTR(MP_QSTR_RX0), MP_ROM_PTR(&pin_GPIO1)}, + {MP_ROM_QSTR(MP_QSTR_TX0), MP_ROM_PTR(&pin_GPIO3)}, + {MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22)}, + {MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23)}, + {MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13)}, + {MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12)}, + {MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14)}, + {MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27)}, + {MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26)}, + {MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25)}, + {MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33)}, + {MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32)}, + {MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35)}, + {MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34)}, + + {MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2)}, + + {MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO21)}, + {MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO22)}, + + {MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18)}, + {MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23)}, + {MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19)}, + + {MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO17)}, + {MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO16)}, + + {MP_ROM_QSTR(MP_QSTR_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/doit_esp32_devkit_v1/sdkconfig b/ports/espressif/boards/doit_esp32_devkit_v1/sdkconfig new file mode 100644 index 0000000000..6c0168c829 --- /dev/null +++ b/ports/espressif/boards/doit_esp32_devkit_v1/sdkconfig @@ -0,0 +1,20 @@ +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_SPIRAM_SUPPORT=n + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings From f8070d2141500e7f21021297e773b2f6fff1f6ab Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 30 Nov 2022 21:51:50 +0200 Subject: [PATCH 192/357] Change comment, and logic on dhcpserver --- ports/raspberrypi/common-hal/wifi/Radio.c | 5 ++++- shared/netutils/dhcpserver.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 0459841b47..313363dd32 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -155,8 +155,11 @@ void common_hal_wifi_radio_start_station(wifi_radio_obj_t *self) { void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self) { - // This is wrong This is fine. cyw43_wifi_leave(&cyw43_state, CYW43_ITF_STA); + // This is wrong, but without this call the state of ITF_STA is still + // reported as CYW43_LINK_JOIN (by wifi_link_status) and CYW43_LINK_UP + // (by tcpip_link_status). However since ap disconnection isn't working + // either, this is not an issue. cyw43_wifi_leave(&cyw43_state, CYW43_ITF_AP); bindings_cyw43_wifi_enforce_pm(); diff --git a/shared/netutils/dhcpserver.c b/shared/netutils/dhcpserver.c index a61501c93c..d396a2ba56 100644 --- a/shared/netutils/dhcpserver.c +++ b/shared/netutils/dhcpserver.c @@ -265,9 +265,9 @@ static void dhcp_server_process(void *arg, struct udp_pcb *upcb, struct pbuf *p, d->lease[yi].expiry = (mp_hal_ticks_ms() + DEFAULT_LEASE_TIME_S * 1000) >> 16; dhcp_msg.yiaddr[3] = DHCPS_BASE_IP + yi; opt_write_u8(&opt, DHCP_OPT_MSG_TYPE, DHCPACK); - printf("DHCPS: client connected: MAC=%02x:%02x:%02x:%02x:%02x:%02x IP=%u.%u.%u.%u\n", + LWIP_DEBUGF(DHCP_DEBUG, ("DHCPS: client connected: MAC=%02x:%02x:%02x:%02x:%02x:%02x IP=%u.%u.%u.%u\n", dhcp_msg.chaddr[0], dhcp_msg.chaddr[1], dhcp_msg.chaddr[2], dhcp_msg.chaddr[3], dhcp_msg.chaddr[4], dhcp_msg.chaddr[5], - dhcp_msg.yiaddr[0], dhcp_msg.yiaddr[1], dhcp_msg.yiaddr[2], dhcp_msg.yiaddr[3]); + dhcp_msg.yiaddr[0], dhcp_msg.yiaddr[1], dhcp_msg.yiaddr[2], dhcp_msg.yiaddr[3])); break; } From 2e9954e43d1b0197b57fae0a1455df0e4a26152b Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 30 Nov 2022 17:37:44 +0000 Subject: [PATCH 193/357] Translated using Weblate (Swedish) Currently translated at 100.0% (997 of 997 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 98f0624ca1..fd715cfc13 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-11-30 16:14+0000\n" +"PO-Revision-Date: 2022-11-30 20:18+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -913,6 +913,7 @@ msgstr "Drivläge används inte när riktning är input." #: py/obj.c msgid "During handling of the above exception, another exception occurred:" msgstr "" +"Under hanteringen av ovanstående undantag inträffade ett annat undantag:" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" @@ -2056,7 +2057,7 @@ msgstr "" #: py/obj.c msgid "The above exception was the direct cause of the following exception:" -msgstr "" +msgstr "Ovanstående undantag var den direkta orsaken till följande undantag:" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" From 0738d50834afc46f75a94c52910a0d0672b4124f Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 30 Nov 2022 22:24:21 +0200 Subject: [PATCH 194/357] debug_dhcp to follow general debug --- ports/raspberrypi/lwip_inc/lwipopts.h | 1 - shared/netutils/dhcpserver.h | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/raspberrypi/lwip_inc/lwipopts.h b/ports/raspberrypi/lwip_inc/lwipopts.h index 6d116e89b6..64b8cffff3 100644 --- a/ports/raspberrypi/lwip_inc/lwipopts.h +++ b/ports/raspberrypi/lwip_inc/lwipopts.h @@ -95,7 +95,6 @@ #define TCPIP_DEBUG LWIP_DBG_OFF #define PPP_DEBUG LWIP_DBG_OFF #define SLIP_DEBUG LWIP_DBG_OFF -#define DHCP_DEBUG LWIP_DBG_OFF #define MDNS_DEBUG LWIP_DBG_OFF #define LWIP_TIMEVAL_PRIVATE 0 diff --git a/shared/netutils/dhcpserver.h b/shared/netutils/dhcpserver.h index 2349d2ea42..45ceaf9a87 100644 --- a/shared/netutils/dhcpserver.h +++ b/shared/netutils/dhcpserver.h @@ -31,6 +31,10 @@ #define DHCPS_BASE_IP (16) #define DHCPS_MAX_IP (8) +#ifndef DHCP_DEBUG +#define DHCP_DEBUG LWIP_DBG_ON +#endif + typedef struct _dhcp_server_lease_t { uint8_t mac[6]; uint16_t expiry; From 0e19fbb60f41c3586725320aa93771ac6c4cac9c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:24:49 -0600 Subject: [PATCH 195/357] Use a function to raise ZeroDivisionError, consistent string --- locale/circuitpython.pot | 58 +++------------------------------------- py/modmath.c | 2 +- py/objcomplex.c | 2 +- py/objfloat.c | 2 +- py/objint_longlong.c | 2 +- py/objint_mpz.c | 2 +- py/runtime.c | 6 ++++- py/runtime.h | 1 + 8 files changed, 15 insertions(+), 60 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3958d2869a..9928ca03e0 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -118,7 +118,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -130,14 +130,10 @@ msgstr "" msgid "%q length must be <= %d" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/busio/I2C.c msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -163,14 +159,6 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - #: py/argcheck.c py/obj.c msgid "%q must be of type %q" msgstr "" @@ -201,10 +189,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "" - #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" msgstr "" @@ -511,10 +495,6 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1260,10 +1240,6 @@ msgstr "" msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1501,11 +1477,6 @@ msgstr "" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2545,10 +2516,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2590,14 +2557,10 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2781,10 +2744,6 @@ msgstr "" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2887,12 +2846,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c shared-bindings/math/__init__.c msgid "division by zero" msgstr "" @@ -4043,10 +3997,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c diff --git a/py/modmath.c b/py/modmath.c index 167d46d02b..bf27e68eaf 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -254,7 +254,7 @@ STATIC mp_obj_t mp_math_log(size_t n_args, const mp_obj_t *args) { if (base <= (mp_float_t)0.0) { math_error(); } else if (base == (mp_float_t)1.0) { - mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("division by zero")); + mp_raise_ZeroDivisionError(); } return mp_obj_new_float(l / MICROPY_FLOAT_C_FUN(log)(base)); } diff --git a/py/objcomplex.c b/py/objcomplex.c index f205249bb4..7f4fd621e6 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -217,7 +217,7 @@ mp_obj_t mp_obj_complex_binary_op(mp_binary_op_t op, mp_float_t lhs_real, mp_flo case MP_BINARY_OP_INPLACE_TRUE_DIVIDE: if (rhs_imag == 0) { if (rhs_real == 0) { - mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("complex division by zero")); + mp_raise_ZeroDivisionError(); } lhs_real /= rhs_real; lhs_imag /= rhs_real; diff --git a/py/objfloat.c b/py/objfloat.c index f8261df933..7aebcfdeb2 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -266,7 +266,7 @@ mp_obj_t mp_obj_float_binary_op(mp_binary_op_t op, mp_float_t lhs_val, mp_obj_t case MP_BINARY_OP_INPLACE_FLOOR_DIVIDE: if (rhs_val == 0) { zero_division_error: - mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("divide by zero")); + mp_raise_ZeroDivisionError(); } // Python specs require that x == (x//y)*y + (x%y) so we must // call divmod to compute the correct floor division, which diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 67ec844f47..d318eab38e 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -236,7 +236,7 @@ mp_obj_t mp_obj_int_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i } zero_division: - mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("division by zero")); + mp_raise_ZeroDivisionError(); } mp_obj_t mp_obj_new_int(mp_int_t value) { diff --git a/py/objint_mpz.c b/py/objint_mpz.c index fd74803fe7..e147e5f08a 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -244,7 +244,7 @@ mp_obj_t mp_obj_int_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i case MP_BINARY_OP_INPLACE_FLOOR_DIVIDE: { if (mpz_is_zero(zrhs)) { zero_division_error: - mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("divide by zero")); + mp_raise_ZeroDivisionError(); } mpz_t rem; mpz_init_zero(&rem); diff --git a/py/runtime.c b/py/runtime.c index e3750b7448..6be5c22335 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -631,7 +631,7 @@ unsupported_op: #endif zero_division: - mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("division by zero")); + mp_raise_ZeroDivisionError(); } mp_obj_t mp_call_function_0(mp_obj_t fun) { @@ -1765,3 +1765,7 @@ NORETURN void mp_raise_recursion_depth(void) { mp_raise_RuntimeError(MP_ERROR_TEXT("maximum recursion depth exceeded")); } #endif + +NORETURN void mp_raise_ZeroDivisionError(void) { + mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("division by zero")); +} diff --git a/py/runtime.h b/py/runtime.h index 923071f7ca..951165e279 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -226,6 +226,7 @@ NORETURN void mp_raise_NotImplementedError(const compressed_string_t *msg); NORETURN void mp_raise_NotImplementedError_varg(const compressed_string_t *fmt, ...); NORETURN void mp_raise_OverflowError_varg(const compressed_string_t *fmt, ...); NORETURN void mp_raise_recursion_depth(void); +NORETURN void mp_raise_ZeroDivisionError(void); #endif #if MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG From f67bca94c4d190e95bd376c1ce883cf17f2437b5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:26:46 -0600 Subject: [PATCH 196/357] On python3 log(0) raises math domain error, not zerodivisionerror --- shared-bindings/math/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 58405564db..42a32749da 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -371,7 +371,7 @@ STATIC mp_obj_t mp_math_log(size_t n_args, const mp_obj_t *args) { #pragma GCC diagnostic ignored "-Wfloat-equal" } else if (base == (mp_float_t)1.0) { #pragma GCC diagnostic pop - mp_raise_msg(&mp_type_ZeroDivisionError, translate("division by zero")); + math_error(); } return mp_obj_new_float(l / MICROPY_FLOAT_C_FUN(log)(base)); } From 5fb191b51c84164788605a7657356eda18ec6baa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:28:33 -0600 Subject: [PATCH 197/357] Use a standard validator --- py/parsenum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/parsenum.c b/py/parsenum.c index adf2a4d84d..24d46705a7 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -55,9 +55,9 @@ mp_obj_t mp_parse_num_integer(const char *restrict str_, size_t len, int base, m mp_obj_t ret_val; // check radix base - if ((base != 0 && base < 2) || base > 36) { + if (base != 0) { // this won't be reached if lex!=NULL - mp_raise_ValueError(MP_ERROR_TEXT("int() arg 2 must be >= 2 and <= 36")); + mp_arg_validate_int_range(base, 2, 36, MP_QSTR_base); } // skip leading space From d61fde349d42d54d10ccb542534ff002bf201abf Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:30:43 -0600 Subject: [PATCH 198/357] re-use an error message --- py/objint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/objint.c b/py/objint.c index b44a2e3b4a..6dc675823f 100644 --- a/py/objint.c +++ b/py/objint.c @@ -396,7 +396,7 @@ mp_obj_t mp_obj_int_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i // This is called only with strings whose value doesn't fit in SMALL_INT mp_obj_t mp_obj_new_int_from_str_len(const char **str, size_t len, bool neg, unsigned int base) { - mp_raise_msg(&mp_type_OverflowError, MP_ERROR_TEXT("long int not supported in this build")); + mp_raise_msg(&mp_type_OverflowError, MP_ERROR_TEXT("small int overflow")); return mp_const_none; } From d39d146352186b61279a0795ca270fcde56a6877 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:36:23 -0600 Subject: [PATCH 199/357] Merge some messages --- locale/circuitpython.pot | 26 +++++--------------------- py/objrange.c | 2 +- py/objslice.c | 2 +- shared-bindings/random/__init__.c | 2 +- 4 files changed, 8 insertions(+), 24 deletions(-) mode change 100755 => 100644 locale/circuitpython.pot diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot old mode 100755 new mode 100644 index 9928ca03e0..e85b9f5d72 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -189,6 +189,10 @@ msgstr "" msgid "%q pin invalid" msgstr "" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" + #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" msgstr "" @@ -2846,7 +2850,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/runtime.c shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "" @@ -3218,10 +3222,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3359,10 +3359,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3897,10 +3893,6 @@ msgstr "" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -3949,10 +3941,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4278,10 +4266,6 @@ msgstr "" msgid "y value out of bounds" msgstr "" -#: py/objrange.c -msgid "zero step" -msgstr "" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" diff --git a/py/objrange.c b/py/objrange.c index b0c74815dc..78a5fcd0f8 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -110,7 +110,7 @@ STATIC mp_obj_t range_make_new(const mp_obj_type_t *type, size_t n_args, size_t if (n_args == 3) { o->step = mp_obj_get_int(args[2]); if (o->step == 0) { - mp_raise_ValueError(MP_ERROR_TEXT("zero step")); + mp_raise_ValueError_varg(MP_ERROR_TEXT("%q step cannot be zero"), MP_QSTR_range); } } } diff --git a/py/objslice.c b/py/objslice.c index 3172f798c0..395af727e8 100644 --- a/py/objslice.c +++ b/py/objslice.c @@ -157,7 +157,7 @@ void mp_obj_slice_indices(mp_obj_t self_in, mp_int_t length, mp_bound_slice_t *r } else { step = mp_obj_get_int(self->step); if (step == 0) { - mp_raise_ValueError(MP_ERROR_TEXT("slice step cannot be zero")); + mp_raise_ValueError_varg(MP_ERROR_TEXT("%q step cannot be zero"), MP_QSTR_slice); } } diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index 29c6a0e74b..fcf432931e 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -108,7 +108,7 @@ STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) { } else if (step < 0) { n = (stop - start + step + 1) / step; } else { - mp_raise_ValueError(translate("step must be non-zero")); + mp_raise_ValueError_varg(MP_ERROR_TEXT("%q step cannot be zero"), MP_QSTR_randrange); } if (n <= 0) { mp_raise_ValueError(translate("invalid step")); From a94663b3c9359e076fd5a49a4f2097996d9351f4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:37:57 -0600 Subject: [PATCH 200/357] use a standard error message --- py/objstrunicode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 0f26da62cf..863bbd42d7 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -159,7 +159,7 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s if (mp_obj_is_small_int(index)) { i = MP_OBJ_SMALL_INT_VALUE(index); } else if (!mp_obj_get_int_maybe(index, &i)) { - mp_raise_TypeError_varg(MP_ERROR_TEXT("string indices must be integers, not %q"), mp_obj_get_type_qstr(index)); + mp_raise_TypeError_varg(translate("%q must be of type %q"), MP_QSTR_index, MP_QSTR_int); } const byte *s, *top = self_data + self_len; if (i < 0) { From 4158ddfc17c825017d4e989d2cdf027f9563e3d6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:40:59 -0600 Subject: [PATCH 201/357] compile out terse mismatch message when not used --- py/argcheck.c | 2 ++ py/runtime.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/py/argcheck.c b/py/argcheck.c index 9ec21d4898..01c712ac36 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -145,9 +145,11 @@ void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t *args, mp_arg_parse_all(n_pos, args, &kw_args, n_allowed, allowed, out_vals); } +#if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE NORETURN void mp_arg_error_terse_mismatch(void) { mp_raise_TypeError(MP_ERROR_TEXT("argument num/types mismatch")); } +#endif #if MICROPY_CPYTHON_COMPAT NORETURN void mp_arg_error_unimpl_kw(void) { diff --git a/py/runtime.h b/py/runtime.h index 951165e279..a5f66b1507 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -91,7 +91,9 @@ static inline void mp_arg_check_num(size_t n_args, size_t n_kw, size_t n_args_mi } void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals); void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t *args, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals); +#if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE NORETURN void mp_arg_error_terse_mismatch(void); +#endif NORETURN void mp_arg_error_unimpl_kw(void); NORETURN void mp_arg_error_invalid(qstr arg_name); From c46e219795db804c04d80ec474b555510ab300b3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 15:46:48 -0600 Subject: [PATCH 202/357] Having an input-only pin is rare, save a string on other ports --- ports/espressif/mpconfigport.h | 2 ++ py/circuitpy_mpconfig.h | 4 ++++ shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c | 4 ++++ shared-bindings/digitalio/DigitalInOut.c | 2 ++ shared-bindings/digitalio/DigitalInOut.h | 2 ++ 5 files changed, 14 insertions(+) diff --git a/ports/espressif/mpconfigport.h b/ports/espressif/mpconfigport.h index 632a7a13cd..1b154b4b99 100644 --- a/ports/espressif/mpconfigport.h +++ b/ports/espressif/mpconfigport.h @@ -99,4 +99,6 @@ #define CIRCUITPY_PORT_NUM_SUPERVISOR_ALLOCATIONS (1) #endif +#define CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY (1) + #endif // MICROPY_INCLUDED_ESPRESSIF_MPCONFIGPORT_H diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index d6d8419c8f..dc528d0787 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -582,6 +582,10 @@ void supervisor_run_background_tasks_if_tick(void); #define MICROPY_WRAP_MP_EXECUTE_BYTECODE PLACE_IN_ITCM #endif +#ifndef CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY +#define CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY (0) +#endif + #ifndef CIRCUITPY_DIGITALIO_HAVE_INVALID_PULL #define CIRCUITPY_DIGITALIO_HAVE_INVALID_PULL (0) #endif diff --git a/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c b/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c index afb11856e2..6626d27f77 100644 --- a/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c +++ b/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c @@ -105,9 +105,13 @@ STATIC mp_obj_t adafruit_bus_device_spidevice_make_new(const mp_obj_type_t *type if (args[ARG_chip_select].u_obj != MP_OBJ_NULL) { digitalinout_result_t result = common_hal_digitalio_digitalinout_switch_to_output(MP_OBJ_TO_PTR(args[ARG_chip_select].u_obj), true, DRIVE_MODE_PUSH_PULL); + #if CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY if (result == DIGITALINOUT_INPUT_ONLY) { mp_raise_NotImplementedError(translate("Pin is input only")); } + #else + (void)result; + #endif } return (mp_obj_t)self; diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index eb3c1ec69d..e6fe592a65 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -53,8 +53,10 @@ STATIC void check_result(digitalinout_result_t result) { return; case DIGITALINOUT_PIN_BUSY: mp_raise_ValueError_varg(translate("%q in use"), MP_QSTR_Pin); + #if CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY case DIGITALINOUT_INPUT_ONLY: mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_direction); + #endif #if CIRCUITPY_DIGITALIO_HAVE_INVALID_PULL case DIGITALINOUT_INVALID_PULL: mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_pull); diff --git a/shared-bindings/digitalio/DigitalInOut.h b/shared-bindings/digitalio/DigitalInOut.h index 80c3970f0e..79a700c905 100644 --- a/shared-bindings/digitalio/DigitalInOut.h +++ b/shared-bindings/digitalio/DigitalInOut.h @@ -38,7 +38,9 @@ extern const mp_obj_type_t digitalio_digitalinout_type; typedef enum { DIGITALINOUT_OK, DIGITALINOUT_PIN_BUSY, + #if CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY DIGITALINOUT_INPUT_ONLY, + #endif #if CIRCUITPY_DIGITALIO_HAVE_INVALID_PULL DIGITALINOUT_INVALID_PULL, #endif From 4671658c63bb39072d79d57c770321e03cc7fd63 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 16:32:34 -0600 Subject: [PATCH 203/357] Use ASCII apostrophe in french translation, it saves flash space .. it makes mchar_t, the type of storage needed for all the code points in all translation messages, be an 8-bit type instead of a 16-bit type --- locale/fr.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 9f6bfba96b..905116cb71 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -684,7 +684,7 @@ msgstr "Les blocs CBC doivent être des multiples de 16 octets" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." -msgstr "L’appareil CIRCUITPY ne peut pas être trouvé ou créé." +msgstr "L'appareil CIRCUITPY ne peut pas être trouvé ou créé." #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" @@ -842,11 +842,11 @@ msgstr "Fichier .mpy corrompu" #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "Impossible d’obtenir l’horloge" +msgstr "Impossible d'obtenir l'horloge" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "Impossible de définir l’adresse" +msgstr "Impossible de définir l'adresse" #: shared-bindings/pwmio/PWMOut.c msgid "Could not start PWM" @@ -1006,7 +1006,7 @@ msgstr "Échec d'allocation du tampon %q" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "Impossible d’allouer la mémoire pour Wifi" +msgstr "Impossible d'allouer la mémoire pour Wifi" #: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" @@ -1833,7 +1833,7 @@ msgstr "Ainsi que tout autres modules présents sur le système de fichiers\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "Polygon a besoin d’au moins 3 points" +msgstr "Polygon a besoin d'au moins 3 points" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -2552,7 +2552,7 @@ msgstr "matrice/octets requis à la droite" #: extmod/ulab/code/numpy/numerical.c msgid "attempt to get (arg)min/(arg)max of empty sequence" -msgstr "tentative d’obtenir (arg)min/(arg)max d'une séquence vide" +msgstr "tentative d'obtenir (arg)min/(arg)max d'une séquence vide" #: extmod/ulab/code/numpy/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" @@ -2620,7 +2620,7 @@ msgstr "tampon est plus petit que la taille demandée" #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "buffer size must be a multiple of element size" -msgstr "taille du tampon doit être un multiple de la taille de l’élément" +msgstr "taille du tampon doit être un multiple de la taille de l'élément" #: shared-module/struct/__init__.c msgid "buffer size must match format" @@ -3181,7 +3181,7 @@ msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" #: extmod/ulab/code/scipy/optimize/optimize.c msgid "function has the same sign at the ends of interval" -msgstr "la fonction a le même signe aux extrémités de l’intervalle" +msgstr "la fonction a le même signe aux extrémités de l'intervalle" #: extmod/ulab/code/ndarray.c msgid "function is defined for ndarrays only" @@ -4186,11 +4186,11 @@ msgstr "le délai (timeout) doit être < 655.35 secondes" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "Délai d’expiration dépassé en attendant une carte v1" +msgstr "Délai d'expiration dépassé en attendant une carte v1" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "Délai d’expiration dépassé en attendant une carte v2" +msgstr "Délai d'expiration dépassé en attendant une carte v2" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "timer re-init" @@ -4390,7 +4390,7 @@ msgstr "width doit être plus que zero" #: ports/espressif/common-hal/wifi/Radio.c #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "wifi is not enabled" -msgstr "wifi n’est pas activé" +msgstr "wifi n'est pas activé" #: ports/raspberrypi/common-hal/wifi/Monitor.c msgid "wifi.Monitor not available" From 9c11bb2ed9b20c8b1709b994336264b724ebd92a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 17:04:58 -0600 Subject: [PATCH 204/357] Check that translations fit in expected character type --- py/maketranslationdata.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/py/maketranslationdata.py b/py/maketranslationdata.py index c0ae85f4e0..19bbc443a3 100644 --- a/py/maketranslationdata.py +++ b/py/maketranslationdata.py @@ -146,7 +146,10 @@ def iter_substrings(s, minlen, maxlen): yield s[begin : begin + n] -def compute_huffman_coding(translations, f): +translation_requires_uint16 = {"cs", "el", "fr", "ja", "ko", "pl", "ru", "tr", "zh_Latn_pinyin"} + + +def compute_huffman_coding(translation_name, translations, f): texts = [t[1] for t in translations] words = [] @@ -163,6 +166,12 @@ def compute_huffman_coding(translations, f): bits_per_codepoint = 16 if max_ord > 255 else 8 values_type = "uint16_t" if max_ord > 255 else "uint8_t" + translation_name = translation_name.split("/")[-1].split(".")[0] + if max_ord > 255 and translation_name not in translation_requires_uint16: + raise ValueError( + f"Translation {translation_name} expected to fit in 8 bits but required 16 bits" + ) + while len(words) < max_words: # Until the dictionary is filled to capacity, use a heuristic to find # the best "word" (2- to 11-gram) to add to it. @@ -522,5 +531,7 @@ if __name__ == "__main__": i18ns = parse_input_headers(args.infiles) i18ns = sorted(i18ns) translations = translate(args.translation, i18ns) - encoding_table = compute_huffman_coding(translations, args.compression_filename) + encoding_table = compute_huffman_coding( + args.translation, translations, args.compression_filename + ) output_translation_data(encoding_table, translations, args.translation_filename) From 6be0a425c751574074ff92637303c1236a8754ab Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 17:05:09 -0600 Subject: [PATCH 205/357] Don't run maketranslationdata twice --- py/py.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/py/py.mk b/py/py.mk index 6827fbe786..0cbfd252f2 100644 --- a/py/py.mk +++ b/py/py.mk @@ -262,8 +262,15 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/ $(STEPECHO) "GEN $@" $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --output_type=data $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ -$(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/compression.generated.h: $(PY_SRC)/maketranslationdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h +# Is generated as a side-effect of building compression.generated.h +# Specifying both in a single rule actually causes the rule to be run twice! +# This alternative makes it run just once. +$(PY_BUILD)/translations-$(TRANSLATION).c: $(HEADER_BUILD)/compression.generated.h + @true + +$(HEADER_BUILD)/compression.generated.h: $(PY_SRC)/maketranslationdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h $(STEPECHO) "GEN $@" + $(Q)mkdir -p $(PY_BUILD) $(Q)$(PYTHON) $(PY_SRC)/maketranslationdata.py --compression_filename $(HEADER_BUILD)/compression.generated.h --translation $(HEADER_BUILD)/$(TRANSLATION).mo --translation_filename $(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/qstrdefs.preprocessed.h PY_CORE_O += $(PY_BUILD)/translations-$(TRANSLATION).o From 530e5a1df274cb352c147c8ce3e24b4bd4f2f475 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 17:08:53 -0600 Subject: [PATCH 206/357] Use standard validation function --- shared-bindings/busio/I2C.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 3dd645b256..e589dea08b 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -344,9 +344,7 @@ STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *p int32_t in_start = args[ARG_in_start].u_int; const int32_t in_end = args[ARG_in_end].u_int; normalize_buffer_bounds(&in_start, in_end, &in_length); - if (in_length == 0) { - mp_raise_ValueError_varg(translate("%q length must be >= %d"), MP_QSTR_out_buffer, 1); - } + mp_arg_validate_length_min(in_length, 1, MP_QSTR_out_buffer); uint8_t status = common_hal_busio_i2c_write_read(self, args[ARG_address].u_int, ((uint8_t *)out_bufinfo.buf) + out_start, out_length,((uint8_t *)in_bufinfo.buf) + in_start, in_length); From 19a3893d40aa07232368f327584d7321446f66d0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 17:48:04 -0600 Subject: [PATCH 207/357] update translations again --- locale/circuitpython.pot | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index e85b9f5d72..1875781e9d 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -130,7 +130,7 @@ msgstr "" msgid "%q length must be <= %d" msgstr "" -#: py/argcheck.c shared-bindings/busio/I2C.c +#: py/argcheck.c msgid "%q length must be >= %d" msgstr "" @@ -159,7 +159,7 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -3949,10 +3949,6 @@ msgstr "" msgid "stream operation not supported" msgstr "" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" From 0f6091cc73e8bc38855015518bb2643be64469e4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 18:54:53 -0600 Subject: [PATCH 208/357] update fil translation to fit in uint8_t --- locale/fil.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fil.po b/locale/fil.po index 2cf6e49da4..8d9a48bd69 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -282,7 +282,7 @@ msgstr "Inaasahan ng '%s' ang hangang r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "Inaasahan ng '%s' ay {r0, r1, …}" +msgstr "Inaasahan ng '%s' ay {r0, r1, ...}" #: py/emitinlinextensa.c #, c-format @@ -2789,7 +2789,7 @@ msgstr "" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "ang color buffer ay dapat bytearray o array na type ‘b’ or ‘B’" +msgstr "ang color buffer ay dapat bytearray o array na type 'b' or 'B'" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" @@ -3911,7 +3911,7 @@ msgstr "return annotation ay dapat na identifier" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "return umasa ng '%q' pero ang nakuha ay ‘%q’" +msgstr "return umasa ng '%q' pero ang nakuha ay '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -4621,7 +4621,7 @@ msgstr "" #~ "Mangyaring bisitahin ang learn.adafruit.com/category/circuitpython para " #~ "sa project guides.\n" #~ "\n" -#~ "Para makita ang listahan ng modules, `help(“modules”)`.\n" +#~ "Para makita ang listahan ng modules, `help(\"modules\")`.\n" #~ msgid "integer required" #~ msgstr "kailangan ng int" From ed33f65fd9c59c2948bdfc5eace43f9046daeae0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 18:57:33 -0600 Subject: [PATCH 209/357] move define to proper place --- ports/espressif/mpconfigport.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/mpconfigport.h b/ports/espressif/mpconfigport.h index 1b154b4b99..c296be2024 100644 --- a/ports/espressif/mpconfigport.h +++ b/ports/espressif/mpconfigport.h @@ -33,6 +33,8 @@ #define MICROPY_USE_INTERNAL_PRINTF (0) #define MICROPY_PY_SYS_PLATFORM "Espressif" +#define CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY (1) + #include "py/circuitpy_mpconfig.h" #if CIRCUITPY_BLEIO @@ -99,6 +101,4 @@ #define CIRCUITPY_PORT_NUM_SUPERVISOR_ALLOCATIONS (1) #endif -#define CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY (1) - #endif // MICROPY_INCLUDED_ESPRESSIF_MPCONFIGPORT_H From 9916b39b656f3a74d522e799a406c05d9172462a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 19:44:33 -0600 Subject: [PATCH 210/357] update nl translation to fit in uint8_t --- locale/nl.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/nl.po b/locale/nl.po index e002370151..acd7b53fd3 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -283,7 +283,7 @@ msgstr "'%s' verwacht op zijn meest r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "'%s' verwacht {r0, r1, …}" +msgstr "'%s' verwacht {r0, r1, ...}" #: py/emitinlinextensa.c #, c-format From d16c9515b7d980ddca02835024762e4d604d5747 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 9 Nov 2022 06:58:09 -0600 Subject: [PATCH 211/357] Compact the characters of certain translations, so they fit in uint8_t This saves a few hundred bytes on the affected translations, such as `el` which shrunk from 186152 to 185588 bytes (564 bytes saved). --- py/maketranslationdata.py | 80 ++++++++++++++++++++++--- supervisor/shared/translate/translate.c | 3 + 2 files changed, 75 insertions(+), 8 deletions(-) diff --git a/py/maketranslationdata.py b/py/maketranslationdata.py index 19bbc443a3..98c3d77dbb 100644 --- a/py/maketranslationdata.py +++ b/py/maketranslationdata.py @@ -10,6 +10,7 @@ supervisor/shared/translate/translate.h from __future__ import print_function import bisect +from dataclasses import dataclass import re import sys @@ -146,7 +147,40 @@ def iter_substrings(s, minlen, maxlen): yield s[begin : begin + n] -translation_requires_uint16 = {"cs", "el", "fr", "ja", "ko", "pl", "ru", "tr", "zh_Latn_pinyin"} +translation_requires_uint16 = {"cs", "fr", "ja", "ko", "pl", "tr", "zh_Latn_pinyin"} + + +def compute_unicode_offset(texts): + all_ch = set(" ".join(texts)) + ch_160 = sorted(c for c in all_ch if 160 <= ord(c) < 255) + ch_256 = sorted(c for c in all_ch if 255 < ord(c)) + if not ch_256: + return 0, 0 + min_256 = ord(min(ch_256)) + span = ord(max(ch_256)) - ord(min(ch_256)) + 1 + + if ch_160: + max_160 = ord(max(ch_160)) + 1 + else: + max_160 = max(160, 255 - span) + + if max_160 + span > 256: + return 0, 0 + + offstart = max_160 + offset = min_256 - max_160 + return offstart, offset + + +@dataclass +class EncodingTable: + values: object + lengths: object + words: object + canonical: object + extractor: object + apply_offset: object + remove_offset: object def compute_huffman_coding(translation_name, translations, f): @@ -156,8 +190,26 @@ def compute_huffman_coding(translation_name, translations, f): start_unused = 0x80 end_unused = 0xFF max_ord = 0 + offstart, offset = compute_unicode_offset(texts) + + def apply_offset(c): + oc = ord(c) + if oc >= offstart: + oc += offset + return chr(oc) + + def remove_offset(c): + oc = ord(c) + if oc >= offstart: + oc = oc - offset + try: + return chr(oc) + except Exception as e: + raise ValueError(f"remove_offset {offstart=} {oc=}") from e + for text in texts: for c in text: + c = remove_offset(c) ord_c = ord(c) max_ord = max(ord_c, max_ord) if 0x80 <= ord_c < 0xFF: @@ -276,15 +328,17 @@ def compute_huffman_coding(translation_name, translations, f): length_count[length] += 1 if last_length: renumbered <<= length - last_length - canonical[atom] = "{0:0{width}b}".format(renumbered, width=length) # print(f"atom={repr(atom)} code={code}", file=sys.stderr) + canonical[atom] = "{0:0{width}b}".format(renumbered, width=length) if len(atom) > 1: o = words.index(atom) + 0x80 s = "".join(C_ESCAPES.get(ch1, ch1) for ch1 in atom) + f.write(f"// {o} {s} {counter[atom]} {canonical[atom]} {renumbered}\n") else: s = C_ESCAPES.get(atom, atom) + canonical[atom] = "{0:0{width}b}".format(renumbered, width=length) o = ord(atom) - f.write(f"// {o} {s} {counter[atom]} {canonical[atom]} {renumbered}\n") + f.write(f"// {o} {s} {counter[atom]} {canonical[atom]} {renumbered}\n") renumbered += 1 last_length = length lengths = bytearray() @@ -306,7 +360,11 @@ def compute_huffman_coding(translation_name, translations, f): f.write("typedef {} mchar_t;\n".format(values_type)) f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) - f.write("const mchar_t values[] = {{ {} }};\n".format(", ".join(str(ord(u)) for u in values))) + f.write( + "const mchar_t values[] = {{ {} }};\n".format( + ", ".join(str(ord(remove_offset(u))) for u in values) + ) + ) f.write( "#define compress_max_length_bits ({})\n".format( max_translation_encoded_length.bit_length() @@ -314,7 +372,7 @@ def compute_huffman_coding(translation_name, translations, f): ) f.write( "const mchar_t words[] = {{ {} }};\n".format( - ", ".join(str(ord(c)) for w in words for c in w) + ", ".join(str(ord(remove_offset(c))) for w in words for c in w) ) ) f.write("const uint8_t wlencount[] = {{ {} }};\n".format(", ".join(str(p) for p in wlencount))) @@ -322,12 +380,17 @@ def compute_huffman_coding(translation_name, translations, f): f.write("#define word_end {}\n".format(word_end)) f.write("#define minlen {}\n".format(minlen)) f.write("#define maxlen {}\n".format(maxlen)) + f.write("#define offstart {}\n".format(offstart)) + f.write("#define offset {}\n".format(offset)) - return (values, lengths, words, canonical, extractor) + return EncodingTable(values, lengths, words, canonical, extractor, apply_offset, remove_offset) def decompress(encoding_table, encoded, encoded_length_bits): - (values, lengths, words, _, _) = encoding_table + values = encoding_table.values + lengths = encoding_table.lengths + words = encoding_table.words + dec = [] this_byte = 0 this_bit = 7 @@ -385,7 +448,8 @@ def decompress(encoding_table, encoded, encoded_length_bits): def compress(encoding_table, decompressed, encoded_length_bits, len_translation_encoded): if not isinstance(decompressed, str): raise TypeError() - (_, _, _, canonical, extractor) = encoding_table + canonical = encoding_table.canonical + extractor = encoding_table.extractor enc = bytearray(len(decompressed) * 3) current_bit = 7 diff --git a/supervisor/shared/translate/translate.c b/supervisor/shared/translate/translate.c index ae6c7524e5..423c5444fd 100644 --- a/supervisor/shared/translate/translate.c +++ b/supervisor/shared/translate/translate.c @@ -57,6 +57,9 @@ STATIC void get_word(int n, const mchar_t **pos, const mchar_t **end) { } STATIC int put_utf8(char *buf, int u) { + if (u >= offstart) { + u += offset; + } if (u <= 0x7f) { *buf = u; return 1; From e5b83821f8b28153c1fdce34c8645d98ec1712f4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 9 Nov 2022 07:00:25 -0600 Subject: [PATCH 212/357] fr should fit in 8 bits --- py/maketranslationdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/maketranslationdata.py b/py/maketranslationdata.py index 98c3d77dbb..938e8de667 100644 --- a/py/maketranslationdata.py +++ b/py/maketranslationdata.py @@ -147,7 +147,7 @@ def iter_substrings(s, minlen, maxlen): yield s[begin : begin + n] -translation_requires_uint16 = {"cs", "fr", "ja", "ko", "pl", "tr", "zh_Latn_pinyin"} +translation_requires_uint16 = {"cs", "ja", "ko", "pl", "tr", "zh_Latn_pinyin"} def compute_unicode_offset(texts): From fb66a6bfe57d5b55c25291ef021c4133a4880ae0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 9 Nov 2022 07:57:36 -0600 Subject: [PATCH 213/357] Don't use "offset" as an identifier --- py/maketranslationdata.py | 4 ++-- supervisor/shared/translate/translate.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py/maketranslationdata.py b/py/maketranslationdata.py index 938e8de667..fbf396c73f 100644 --- a/py/maketranslationdata.py +++ b/py/maketranslationdata.py @@ -380,8 +380,8 @@ def compute_huffman_coding(translation_name, translations, f): f.write("#define word_end {}\n".format(word_end)) f.write("#define minlen {}\n".format(minlen)) f.write("#define maxlen {}\n".format(maxlen)) - f.write("#define offstart {}\n".format(offstart)) - f.write("#define offset {}\n".format(offset)) + f.write("#define translation_offstart {}\n".format(offstart)) + f.write("#define translation_offset {}\n".format(offset)) return EncodingTable(values, lengths, words, canonical, extractor, apply_offset, remove_offset) diff --git a/supervisor/shared/translate/translate.c b/supervisor/shared/translate/translate.c index 423c5444fd..b07aa584ca 100644 --- a/supervisor/shared/translate/translate.c +++ b/supervisor/shared/translate/translate.c @@ -57,8 +57,8 @@ STATIC void get_word(int n, const mchar_t **pos, const mchar_t **end) { } STATIC int put_utf8(char *buf, int u) { - if (u >= offstart) { - u += offset; + if (u >= translation_offstart) { + u += translation_offset; } if (u <= 0x7f) { *buf = u; From d2e2a6107523951c9ab93a4ef812b7ffaeb06866 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 9 Nov 2022 08:28:56 -0600 Subject: [PATCH 214/357] Reworking how "run list" works saves a dozen bytes --- main.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/main.c b/main.c index 10fdc65224..d70e718b6d 100644 --- a/main.c +++ b/main.c @@ -218,12 +218,10 @@ void supervisor_execution_status(void) { } #endif -#define STRING_LIST(...) {__VA_ARGS__, ""} - // Look for the first file that exists in the list of filenames, using mp_import_stat(). // Return its index. If no file found, return -1. -STATIC const char *first_existing_file_in_list(const char *const *filenames) { - for (int i = 0; filenames[i] != (char *)""; i++) { +STATIC const char *first_existing_file_in_list(const char *const *filenames, size_t n_filenames) { + for (size_t i = 0; i < n_filenames; i++) { mp_import_stat_t stat = mp_import_stat(filenames[i]); if (stat == MP_IMPORT_STAT_FILE) { return filenames[i]; @@ -232,11 +230,11 @@ STATIC const char *first_existing_file_in_list(const char *const *filenames) { return NULL; } -STATIC bool maybe_run_list(const char *const *filenames) { +STATIC bool maybe_run_list(const char *const *filenames, size_t n_filenames) { _exec_result.return_code = 0; _exec_result.exception = MP_OBJ_NULL; _exec_result.exception_line = 0; - _current_executing_filename = first_existing_file_in_list(filenames); + _current_executing_filename = first_existing_file_in_list(filenames, n_filenames); if (_current_executing_filename == NULL) { return false; } @@ -391,12 +389,14 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { filesystem_flush(); } if (safe_mode == NO_SAFE_MODE && !autoreload_pending()) { - static const char *const supported_filenames[] = STRING_LIST( - "code.txt", "code.py", "main.py", "main.txt"); + static const char *const supported_filenames[] = { + "code.txt", "code.py", "main.py", "main.txt" + }; #if CIRCUITPY_FULL_BUILD - static const char *const double_extension_filenames[] = STRING_LIST( + static const char *const double_extension_filenames[] = { "code.txt.py", "code.py.txt", "code.txt.txt","code.py.py", - "main.txt.py", "main.py.txt", "main.txt.txt","main.py.py"); + "main.txt.py", "main.py.txt", "main.txt.txt","main.py.py" + }; #endif supervisor_allocation *heap = allocate_remaining_memory(); @@ -410,14 +410,15 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { // Check if a different run file has been allocated if (next_code_allocation) { - ((next_code_info_t *)next_code_allocation->ptr)->options &= ~SUPERVISOR_NEXT_CODE_OPT_NEWLY_SET; - next_code_options = ((next_code_info_t *)next_code_allocation->ptr)->options; - if (((next_code_info_t *)next_code_allocation->ptr)->filename[0] != '\0') { - const char *next_list[] = {((next_code_info_t *)next_code_allocation->ptr)->filename, ""}; + next_code_info_t *info = ((next_code_info_t *)next_code_allocation->ptr); + info->options &= ~SUPERVISOR_NEXT_CODE_OPT_NEWLY_SET; + next_code_options = info->options; + if (info->filename[0] != '\0') { // This is where the user's python code is actually executed: - found_main = maybe_run_list(next_list); + const char *const filenames[] = { info->filename }; + found_main = maybe_run_list(filenames, MP_ARRAY_SIZE(filenames)); if (!found_main) { - serial_write(((next_code_info_t *)next_code_allocation->ptr)->filename); + serial_write(info->filename); serial_write_compressed(translate(" not found.\n")); } } @@ -425,11 +426,11 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) { // Otherwise, default to the standard list of filenames if (!found_main) { // This is where the user's python code is actually executed: - found_main = maybe_run_list(supported_filenames); + found_main = maybe_run_list(supported_filenames, MP_ARRAY_SIZE(supported_filenames)); // If that didn't work, double check the extensions #if CIRCUITPY_FULL_BUILD if (!found_main) { - found_main = maybe_run_list(double_extension_filenames); + found_main = maybe_run_list(double_extension_filenames, MP_ARRAY_SIZE(double_extension_filenames)); if (found_main) { serial_write_compressed(translate("WARNING: Your code filename has two extensions\n")); } @@ -741,7 +742,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { && safe_mode == NO_SAFE_MODE && MP_STATE_VM(vfs_mount_table) != NULL; - static const char *const boot_py_filenames[] = STRING_LIST("boot.py", "boot.txt"); + static const char *const boot_py_filenames[] = {"boot.py", "boot.txt"}; // Do USB setup even if boot.py is not run. @@ -778,7 +779,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { port_boot_info(); #endif - bool found_boot = maybe_run_list(boot_py_filenames); + bool found_boot = maybe_run_list(boot_py_filenames, MP_ARRAY_SIZE(boot_py_filenames)); (void)found_boot; From 3fb4fd81e9afd4a129b86a1247816fc07f3b98c7 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Wed, 30 Nov 2022 22:44:18 +0200 Subject: [PATCH 215/357] Revert "debug_dhcp to follow general debug" --- ports/raspberrypi/lwip_inc/lwipopts.h | 1 + shared/netutils/dhcpserver.h | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/raspberrypi/lwip_inc/lwipopts.h b/ports/raspberrypi/lwip_inc/lwipopts.h index 64b8cffff3..6d116e89b6 100644 --- a/ports/raspberrypi/lwip_inc/lwipopts.h +++ b/ports/raspberrypi/lwip_inc/lwipopts.h @@ -95,6 +95,7 @@ #define TCPIP_DEBUG LWIP_DBG_OFF #define PPP_DEBUG LWIP_DBG_OFF #define SLIP_DEBUG LWIP_DBG_OFF +#define DHCP_DEBUG LWIP_DBG_OFF #define MDNS_DEBUG LWIP_DBG_OFF #define LWIP_TIMEVAL_PRIVATE 0 diff --git a/shared/netutils/dhcpserver.h b/shared/netutils/dhcpserver.h index 45ceaf9a87..2349d2ea42 100644 --- a/shared/netutils/dhcpserver.h +++ b/shared/netutils/dhcpserver.h @@ -31,10 +31,6 @@ #define DHCPS_BASE_IP (16) #define DHCPS_MAX_IP (8) -#ifndef DHCP_DEBUG -#define DHCP_DEBUG LWIP_DBG_ON -#endif - typedef struct _dhcp_server_lease_t { uint8_t mac[6]; uint16_t expiry; From 65e913ecd6be55da903b7862d705b7e89cb3c51d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 30 Nov 2022 14:22:46 -0800 Subject: [PATCH 216/357] Fix writing files from web workflow Pico W changes assumed that f_write could handle a NULL fourth argument. It can't. --- supervisor/shared/web_workflow/web_workflow.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 3527090f1e..231b1e8ffb 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -907,8 +907,13 @@ static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *req error = true; break; } - f_write(&active_file, bytes, len, NULL); total_read += len; + UINT actual; + f_write(&active_file, bytes, len, &actual); + if (actual < (UINT)len) { + error = true; + break; + } } f_close(&active_file); @@ -917,7 +922,10 @@ static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *req #endif override_fattime(0); - if (new_file) { + if (error) { + _discard_incoming(socket, request->content_length - total_read); + _reply_server_error(socket, request); + } else if (new_file) { _reply_created(socket, request); } else { _reply_no_content(socket, request); From 0563487433fa8efd19822e30b866d33d9447eb0d Mon Sep 17 00:00:00 2001 From: foamyguy Date: Wed, 30 Nov 2022 19:16:20 -0600 Subject: [PATCH 217/357] get slicing --- shared-bindings/_pixelmap/PixelMap.c | 50 ++++++++++++++++++++-------- shared-bindings/_pixelmap/PixelMap.h | 3 +- shared-module/_pixelmap/PixelMap.c | 26 ++++++--------- 3 files changed, 50 insertions(+), 29 deletions(-) diff --git a/shared-bindings/_pixelmap/PixelMap.c b/shared-bindings/_pixelmap/PixelMap.c index c5f7e0ddb5..94fa4d5c96 100644 --- a/shared-bindings/_pixelmap/PixelMap.c +++ b/shared-bindings/_pixelmap/PixelMap.c @@ -135,7 +135,7 @@ MP_PROPERTY_GETTER(pixelmap_pixelmap_byteorder_obj, (mp_obj_t)&pixelmap_pixelmap_get_byteorder); //| -//| def fill(self, color: PixelType, /) -> None: +//| def fill(self, color: PixelType) -> None: //| """Fill all the pixels in the map with the given color""" STATIC mp_obj_t pixelmap_pixelmap_fill(const mp_obj_t self_in, const mp_obj_t color) { pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -146,7 +146,7 @@ STATIC mp_obj_t pixelmap_pixelmap_fill(const mp_obj_t self_in, const mp_obj_t co MP_DEFINE_CONST_FUN_OBJ_2(pixelmap_pixelmap_fill_obj, pixelmap_pixelmap_fill); //| -//| def indices(self, index: int, /) -> Tuple[int]: +//| def indices(self, index: int) -> Tuple[int]: //| """Return the PixelBuf indices for a PixelMap index""" STATIC mp_obj_t pixelmap_pixelmap_indices(const mp_obj_t self_in, const mp_obj_t index) { pixelmap_pixelmap_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -157,10 +157,14 @@ STATIC mp_obj_t pixelmap_pixelmap_indices(const mp_obj_t self_in, const mp_obj_t MP_DEFINE_CONST_FUN_OBJ_2(pixelmap_pixelmap_indices_obj, pixelmap_pixelmap_indices); +//| @overload +//| def __getitem__(self, index: slice) -> PixelReturnSequence: +//| """Retrieve the value of the underlying pixels.""" +//| ... +//| @overload //| def __getitem__(self, index: int) -> PixelReturnType: -//| """Retrieve the value of one of the underlying pixels at 'index'. -//| -//| Note that slices are not supported by PixelMap.__getitem__""" +//| """Retrieve the value of one of the underlying pixels at 'index'.""" +//| ... //| @overload //| def __setitem__(self, index: slice, value: PixelSequence) -> None: ... //| @overload @@ -176,21 +180,41 @@ STATIC mp_obj_t pixelmap_pixelmap_subscr(mp_obj_t self_in, mp_obj_t index_in, mp if (value == MP_OBJ_NULL) { // delete return MP_OBJ_NULL; // op not supported - } else if (value == MP_OBJ_SENTINEL) { - int index = mp_obj_get_int(index_in); - return shared_module_pixelmap_pixelmap_getitem(self, index); } - // get if (0) { #if MICROPY_PY_BUILTINS_SLICE } else if (mp_obj_is_type(index_in, &mp_type_slice)) { - shared_module_pixelmap_pixelmap_setslice(self, index_in, value); + mp_bound_slice_t slice; + mp_seq_get_fast_slice_indexes(self->len, index_in, &slice); + size_t slice_len; + if (slice.step > 0) { + slice_len = slice.stop - slice.start; + } else { + slice_len = 1 + slice.start - slice.stop; + } + if (slice.step > 1 || slice.step < -1) { + size_t step = slice.step > 0 ? slice.step : slice.step * -1; + slice_len = (slice_len / step) + (slice_len % step ? 1 : 0); + } + + if (value == MP_OBJ_SENTINEL) { // Get + return shared_module_pixelmap_pixelmap_getslice(self, slice, slice_len); + } else { // Set + shared_module_pixelmap_pixelmap_setslice(self, value, slice, slice_len); + return mp_const_none; + } #endif - } else { - shared_module_pixelmap_pixelmap_setitem(self, mp_obj_get_int(index_in), value); + } else { // single index + int index = mp_obj_get_int(index_in); + + if (value == MP_OBJ_SENTINEL) { // Get + return shared_module_pixelmap_pixelmap_getitem(self, index); + } else { + shared_module_pixelmap_pixelmap_setitem(self, mp_obj_get_int(index_in), value); + return mp_const_none; + } } - return mp_const_none; } //| def __len__(self) -> int: diff --git a/shared-bindings/_pixelmap/PixelMap.h b/shared-bindings/_pixelmap/PixelMap.h index 420df1b9e9..fef0db44d0 100644 --- a/shared-bindings/_pixelmap/PixelMap.h +++ b/shared-bindings/_pixelmap/PixelMap.h @@ -37,6 +37,7 @@ bool shared_module_pixelmap_pixelmap_auto_write_get(pixelmap_pixelmap_obj_t *sel void shared_module_pixelmap_pixelmap_auto_write_set(pixelmap_pixelmap_obj_t *self, bool auto_write); void shared_module_pixelmap_pixelmap_fill(pixelmap_pixelmap_obj_t *self, const mp_obj_t color); mp_obj_t shared_module_pixelmap_pixelmap_indices(pixelmap_pixelmap_obj_t *self, int index); -void shared_module_pixelmap_pixelmap_setslice(pixelmap_pixelmap_obj_t *self, const mp_obj_t slice_in, const mp_obj_t value); +void shared_module_pixelmap_pixelmap_setslice(pixelmap_pixelmap_obj_t *self, const mp_obj_t value, mp_bound_slice_t slice, size_t slice_len); +mp_obj_t shared_module_pixelmap_pixelmap_getslice(pixelmap_pixelmap_obj_t *self, mp_bound_slice_t slice, size_t slice_len); mp_obj_t shared_module_pixelmap_pixelmap_getitem(pixelmap_pixelmap_obj_t *self, mp_int_t index); void shared_module_pixelmap_pixelmap_setitem(pixelmap_pixelmap_obj_t *self, mp_int_t index, const mp_obj_t value); diff --git a/shared-module/_pixelmap/PixelMap.c b/shared-module/_pixelmap/PixelMap.c index d20a6dd03c..5eaad0b2f8 100644 --- a/shared-module/_pixelmap/PixelMap.c +++ b/shared-module/_pixelmap/PixelMap.c @@ -34,7 +34,7 @@ static void pixelmap_set_pixel_rgbw(pixelmap_pixelmap_obj_t *self, size_t i, color_u rgbw) { - mp_arg_validate_index_range(i, 0, self->len, MP_QSTR_index); + mp_arg_validate_index_range(i, 0, self->len - 1, MP_QSTR_index); mp_obj_t item = self->items[i]; if (mp_obj_is_small_int(item)) { @@ -109,20 +109,16 @@ mp_obj_t shared_module_pixelmap_pixelmap_indices(pixelmap_pixelmap_obj_t *self, } #if MICROPY_PY_BUILTINS_SLICE -void shared_module_pixelmap_pixelmap_setslice(pixelmap_pixelmap_obj_t *self, const mp_obj_t slice_in, const mp_obj_t values) { - mp_bound_slice_t slice; - mp_seq_get_fast_slice_indexes(self->len, slice_in, &slice); - size_t slice_len; - if (slice.step > 0) { - slice_len = slice.stop - slice.start; - } else { - slice_len = 1 + slice.start - slice.stop; - } - if (slice.step > 1 || slice.step < -1) { - size_t step = slice.step > 0 ? slice.step : slice.step * -1; - slice_len = (slice_len / step) + (slice_len % step ? 1 : 0); - } +mp_obj_t shared_module_pixelmap_pixelmap_getslice(pixelmap_pixelmap_obj_t *self, mp_bound_slice_t slice, size_t slice_len) { + mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(slice_len, NULL)); + for (uint i = 0; i < slice_len; i++) { + t->items[i] = shared_module_pixelmap_pixelmap_getitem(self, i * slice.step + slice.start); + } + return MP_OBJ_FROM_PTR(t); +} + +void shared_module_pixelmap_pixelmap_setslice(pixelmap_pixelmap_obj_t *self, const mp_obj_t values, mp_bound_slice_t slice, size_t slice_len) { size_t num_items = mp_obj_get_int(mp_obj_len(values)); if (num_items != slice_len) { mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d, got %d)."), slice_len, num_items); @@ -165,7 +161,7 @@ void shared_module_pixelmap_pixelmap_setitem(pixelmap_pixelmap_obj_t *self, mp_i } mp_obj_t shared_module_pixelmap_pixelmap_getitem(pixelmap_pixelmap_obj_t *self, mp_int_t i) { - mp_arg_validate_index_range(i, 0, self->len, MP_QSTR_index); + mp_arg_validate_index_range(i, 0, self->len - 1, MP_QSTR_index); mp_obj_t item = self->items[i]; if (mp_obj_is_small_int(item)) { return common_hal_adafruit_pixelbuf_pixelbuf_get_pixel(self->pixelbuf, MP_OBJ_SMALL_INT_VALUE(item)); From 4f471dbd0840db22c51d17d66eb94799e1277f4d Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 1 Dec 2022 07:55:39 +0100 Subject: [PATCH 218/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 97 ++++++--------------------- locale/cs.po | 106 ++++++++--------------------- locale/de_DE.po | 139 +++++++++++++++++--------------------- locale/el.po | 99 ++++++--------------------- locale/en_GB.po | 131 +++++++++++++++--------------------- locale/es.po | 131 +++++++++++++++--------------------- locale/fil.po | 106 +++++++++-------------------- locale/fr.po | 140 ++++++++++++++++++--------------------- locale/hi.po | 82 ++--------------------- locale/it_IT.po | 106 +++++++++-------------------- locale/ja.po | 112 ++++++++++--------------------- locale/ko.po | 85 +++--------------------- locale/nl.po | 115 +++++++++++--------------------- locale/pl.po | 106 +++++++++-------------------- locale/pt_BR.po | 139 +++++++++++++++++--------------------- locale/ru.po | 106 ++++++++--------------------- locale/sv.po | 139 +++++++++++++++++--------------------- locale/tr.po | 99 ++++++--------------------- locale/zh_Latn_pinyin.po | 139 +++++++++++++++++--------------------- 19 files changed, 724 insertions(+), 1453 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 0bf1cf9323..1252722c70 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -124,7 +124,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -140,10 +140,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "%q panjang harus >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -169,15 +165,7 @@ msgstr "%q harus >= %d" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q harus berupa string" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q harus bertipe %q" @@ -207,8 +195,8 @@ msgstr "%q di luar jangkauan" msgid "%q pin invalid" msgstr "pin %q tidak valid" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -517,10 +505,6 @@ msgstr "Array harus mengandung halfwords (ketik 'H')" msgid "Array values should be single bytes." msgstr "Nilai array harus berupa byte tunggal." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Paling banyak %d %q dapat ditentukan (bukan %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1275,10 +1259,6 @@ msgstr "Akses memori tidak valid." msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Pin-pin tidak valid" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1516,11 +1496,6 @@ msgstr "Tidak ada kunci yang ditentukan" msgid "No long integer support" msgstr "Tidak ada dukungan bilangan bulat yang panjang" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2576,10 +2551,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2621,14 +2592,10 @@ msgstr "tidak dapat menetapkan ke ekspresi" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2812,10 +2779,6 @@ msgstr "" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2918,12 +2881,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "" @@ -3295,10 +3253,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3436,10 +3390,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3975,10 +3925,6 @@ msgstr "" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4027,10 +3973,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4039,10 +3981,6 @@ msgstr "" msgid "stream operation not supported" msgstr "" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4075,10 +4013,6 @@ msgstr "sintaksis error pada JSON" msgid "syntax error in uctypes descriptor" msgstr "sintaksis error pada pendeskripsi uctypes" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4360,10 +4294,6 @@ msgstr "xTaskCreate gagal" msgid "y value out of bounds" msgstr "Nilai y di luar batas" -#: py/objrange.c -msgid "zero step" -msgstr "nol langkah" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi harus ndarray" @@ -4376,6 +4306,21 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "%q length must be >= 1" +#~ msgstr "%q panjang harus >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q harus berupa string" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Paling banyak %d %q dapat ditentukan (bukan %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Pin-pin tidak valid" + +#~ msgid "zero step" +#~ msgstr "nol langkah" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "indeks %q harus bilangan bulat, bukan %s" diff --git a/locale/cs.po b/locale/cs.po index 952c7dca61..a08a8c14f8 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -125,7 +125,7 @@ msgstr "Inicializace %q selhala" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "Délka %q musí být %d" @@ -141,10 +141,6 @@ msgstr "Délka %q musí být <= %d" msgid "%q length must be >= %d" msgstr "Délka %q musí být >= %d" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "%q délka musí být >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q musí být %d" @@ -170,15 +166,7 @@ msgstr "%q musí být >= %d" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q musí být string" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q musí být int" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q musí být typu %q" @@ -208,9 +196,9 @@ msgstr "%q je mimo rozsah" msgid "%q pin invalid" msgstr "pin %q není platný" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "%q s ID 0 musím být délky 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -518,10 +506,6 @@ msgstr "Pole musí obsahovat poloviční slova (typ „H“)" msgid "Array values should be single bytes." msgstr "Hodnoty pole by měly být jednoduché bajty." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Lze zadat maximálně %d %q (nikoli %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1275,10 +1259,6 @@ msgstr "Neplatný přístup k paměti." msgid "Invalid multicast MAC address" msgstr "Chybná multicastová MAC adresa" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Neplatné piny" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Chybná velikost" @@ -1516,11 +1496,6 @@ msgstr "Nebyl zadán klíč" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "Ne více než %d HID zařízení je povoleno" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "Žádná síť s takovým SSID" @@ -2563,10 +2538,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2608,14 +2579,10 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2799,10 +2766,6 @@ msgstr "" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2905,12 +2868,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "" @@ -3282,10 +3240,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3423,10 +3377,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3961,10 +3911,6 @@ msgstr "" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4013,10 +3959,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4025,10 +3967,6 @@ msgstr "" msgid "stream operation not supported" msgstr "" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4061,10 +3999,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4346,10 +4280,6 @@ msgstr "" msgid "y value out of bounds" msgstr "" -#: py/objrange.c -msgid "zero step" -msgstr "" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" @@ -4362,6 +4292,28 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q length must be >= 1" +#~ msgstr "%q délka musí být >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q musí být string" + +#~ msgid "%q must be an int" +#~ msgstr "%q musí být int" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "%q s ID 0 musím být délky 1" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Lze zadat maximálně %d %q (nikoli %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Neplatné piny" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "Ne více než %d HID zařízení je povoleno" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "Indexy %q musí být celá čísla, nikoli %s" diff --git a/locale/de_DE.po b/locale/de_DE.po index 79ab102d09..04a05d4b9a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -126,7 +126,7 @@ msgstr "%q Initialisierung ist gescheitert" msgid "%q is %q" msgstr "%q ist %q" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q länge muss %d betragen" @@ -142,10 +142,6 @@ msgstr "%q länge muss kleiner oder gleich %d sein" msgid "%q length must be >= %d" msgstr "%q länge muss größer oder gleich %d sein" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "%q Länge muss >= 1 sein" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q muss %d entsprechen" @@ -172,15 +168,7 @@ msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" "%q muss ein Byte-Array oder ein array vom Typ 'h', 'H', 'b', oder 'B' sein" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q muss ein String sein" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q muss vom Typ Integer sein" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q muss vom Type %q sein" @@ -210,9 +198,9 @@ msgstr "%q außerhalb des Bereichs" msgid "%q pin invalid" msgstr "%q Pin ungültig" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "%q mit Berichts-ID von 0 muss von Länge 1 sein" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -521,10 +509,6 @@ msgstr "Array muss Halbwörter enthalten (type 'H')" msgid "Array values should be single bytes." msgstr "Array-Werte sollten aus Einzelbytes bestehen." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1290,10 +1274,6 @@ msgstr "Ungültiger Speicherzugriff." msgid "Invalid multicast MAC address" msgstr "Ungültige Multicast-MAC-Adresse" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Ungültige Pins" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Ungültige Größe" @@ -1532,11 +1512,6 @@ msgstr "Es wurde kein Schlüssel angegeben" msgid "No long integer support" msgstr "Keine langen Integer (long) unterstützt" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "Keine weiteren %d HID-Geräte zulässig" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "Kein Netzwerk mit dieser SSID" @@ -2618,10 +2593,6 @@ msgstr "Der Puffer ist zu klein" msgid "buffer too small for requested bytes" msgstr "Der Puffer ist zu klein für die angefragten Bytes" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "Byteorder ist kein String" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "Byte-Länge ist kein vielfaches der Item-Größe" @@ -2665,14 +2636,10 @@ msgstr "kann keinem Ausdruck zuweisen" msgid "can't cancel self" msgstr "kann self nicht abbrechen" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "kann %q nicht zu %q konvertieren" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "kann %q nicht nach int konvertieren" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2864,10 +2831,6 @@ msgstr "Farbe muss zwischen 0x000000 und 0xffffff liegen" msgid "comparison of int and uint" msgstr "Vergleich von int und uint" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "Komplexe Division durch null" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "Komplexe Zahlen nicht unterstützt" @@ -2972,12 +2935,7 @@ msgstr "Abmessungen stimmen nicht überein" msgid "div/mod not implemented for uint" msgstr "div/mod für uint nicht implementiert" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "durch Null dividieren" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "Division durch Null" @@ -3353,10 +3311,6 @@ msgstr "Eingabevektoren müssen gleich lang sein" msgid "inputs are not iterable" msgstr "Eingaben sind nicht iterierbar" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int() arg 2 muss >= 2 und <= 36 sein" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "interp ist für 1D-Iterables gleicher Länge definiert" @@ -3500,10 +3454,6 @@ msgstr "" "Es wurde versucht auf eine Variable zuzugreifen, die es (noch) nicht gibt. " "Variablen immer zuerst Zuweisen" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "long int wird in diesem Build nicht unterstützt" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "Loopback + Silent Mode wird vom Peripheriegerät nicht unterstützt" @@ -4043,10 +3993,6 @@ msgstr "Die Schlafdauer darf nicht negativ sein" msgid "slice step can't be zero" msgstr "Slice-Schritt darf nicht Null sein" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "Der Slice-Schritt kann nicht Null sein" - #: py/nativeglue.c msgid "slice unsupported" msgstr "Slice nicht unterstützt" @@ -4095,10 +4041,6 @@ msgstr "source_bitmap muss value_count von 8 haben" msgid "start/end indices" msgstr "start/end Indizes" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "Schritt (step) darf nicht Null sein" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop ist von start aus nicht erreichbar" @@ -4107,10 +4049,6 @@ msgstr "stop ist von start aus nicht erreichbar" msgid "stream operation not supported" msgstr "stream operation ist nicht unterstützt" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "String Indizes müssen Integer sein, nicht %q" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "Zeichenfolgen werden nicht unterstützt; verwende bytes oder bytearray" @@ -4143,10 +4081,6 @@ msgstr "Syntaxfehler in JSON" msgid "syntax error in uctypes descriptor" msgstr "Syntaxfehler in uctypes Deskriptor" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() nimmt eine 9-Sequenz an" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4430,10 +4364,6 @@ msgstr "xTaskCreate fehlgeschlagen" msgid "y value out of bounds" msgstr "y Wert außerhalb der Grenzen" -#: py/objrange.c -msgid "zero step" -msgstr "Nullschritt" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi muss ein ndarray sein" @@ -4446,6 +4376,61 @@ 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 "%q length must be >= 1" +#~ msgstr "%q Länge muss >= 1 sein" + +#~ msgid "%q must be a string" +#~ msgstr "%q muss ein String sein" + +#~ msgid "%q must be an int" +#~ msgstr "%q muss vom Typ Integer sein" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "%q mit Berichts-ID von 0 muss von Länge 1 sein" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Ungültige Pins" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "Keine weiteren %d HID-Geräte zulässig" + +#~ msgid "byteorder is not a string" +#~ msgstr "Byteorder ist kein String" + +#~ msgid "can't convert %q to int" +#~ msgstr "kann %q nicht nach int konvertieren" + +#~ msgid "complex division by zero" +#~ msgstr "Komplexe Division durch null" + +#~ msgid "divide by zero" +#~ msgstr "durch Null dividieren" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "int() arg 2 muss >= 2 und <= 36 sein" + +#~ msgid "long int not supported in this build" +#~ msgstr "long int wird in diesem Build nicht unterstützt" + +#~ msgid "slice step cannot be zero" +#~ msgstr "Der Slice-Schritt kann nicht Null sein" + +#~ msgid "step must be non-zero" +#~ msgstr "Schritt (step) darf nicht Null sein" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "String Indizes müssen Integer sein, nicht %q" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() nimmt eine 9-Sequenz an" + +#~ msgid "zero step" +#~ msgstr "Nullschritt" + #~ msgid "invalid traceback" #~ msgstr "ungültiger Traceback" diff --git a/locale/el.po b/locale/el.po index 98b2e191aa..94f2418c97 100644 --- a/locale/el.po +++ b/locale/el.po @@ -130,7 +130,7 @@ msgstr "%q εκκίνηση απέτυχε" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q μήκος πρέπει να είναι %d" @@ -146,10 +146,6 @@ msgstr "%q μήκος πρέπει να είναι <= %d" msgid "%q length must be >= %d" msgstr "%q μήκος πρέπει να είναι >= %d" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "%q μήκος πρέπει να είναι >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q πρέπει να είναι %d" @@ -175,15 +171,7 @@ msgstr "%q πρέπει να είναι >= %d" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q πρέπει να είναι bytearray ή array τύπου 'h', 'H', 'b', ή 'B'" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q πρέπει να είναι string" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q πρέπει να είναι int" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q πρέπει να είναι τύπου %q" @@ -213,9 +201,9 @@ msgstr "%q εκτός εμβέλειας" msgid "%q pin invalid" msgstr "%q άκυρο pin" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "%q με ID αναφοράς 0 πρέπει να έχει μήκος 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -524,10 +512,6 @@ msgstr "H παράταξη πρέπει να περιέχει halfwords (τύπ msgid "Array values should be single bytes." msgstr "Η τιμές της παράταξη πρέπει να είναι μονά bytes." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Το πολύ %d %q μπορεί να είναι καθορισμένα (όχι %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1285,10 +1269,6 @@ msgstr "" msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1526,11 +1506,6 @@ msgstr "" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2572,10 +2547,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2617,14 +2588,10 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2808,10 +2775,6 @@ msgstr "" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2914,12 +2877,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "" @@ -3291,10 +3249,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3432,10 +3386,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3970,10 +3920,6 @@ msgstr "" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4022,10 +3968,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4034,10 +3976,6 @@ msgstr "" msgid "stream operation not supported" msgstr "" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4070,10 +4008,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4355,10 +4289,6 @@ msgstr "" msgid "y value out of bounds" msgstr "" -#: py/objrange.c -msgid "zero step" -msgstr "" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" @@ -4371,6 +4301,21 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q length must be >= 1" +#~ msgstr "%q μήκος πρέπει να είναι >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q πρέπει να είναι string" + +#~ msgid "%q must be an int" +#~ msgstr "%q πρέπει να είναι int" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "%q με ID αναφοράς 0 πρέπει να έχει μήκος 1" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Το πολύ %d %q μπορεί να είναι καθορισμένα (όχι %d)" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q δείκτες πρέπει να είναι ακέραιοι, όχι %s" diff --git a/locale/en_GB.po b/locale/en_GB.po index d6c8f96d6e..de0d9a513a 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -128,7 +128,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -144,10 +144,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "%q length must be >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -173,15 +169,7 @@ msgstr "%q must be >= %d" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q must be a string" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -211,8 +199,8 @@ msgstr "%q out of range" msgid "%q pin invalid" msgstr "%q pin invalid" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -521,10 +509,6 @@ msgstr "Array must contain halfwords (type 'H')" msgid "Array values should be single bytes." msgstr "Array values should be single bytes." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "At most %d %q may be specified (not %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1276,10 +1260,6 @@ msgstr "Invalid memory access." msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Invalid pins" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Invalid size" @@ -1517,11 +1497,6 @@ msgstr "No key was specified" msgid "No long integer support" msgstr "No long integer support" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "No more than %d HID devices allowed" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "No network with that ssid" @@ -2579,10 +2554,6 @@ msgstr "Buffer too small" msgid "buffer too small for requested bytes" msgstr "Buffer too small for requested bytes" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "Byteorder is not a string" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "Bytes length not a multiple of item size" @@ -2624,14 +2595,10 @@ msgstr "Can't assign to expression" msgid "can't cancel self" msgstr "can't cancel self" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "Can't convert %q to %q" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "can't convert %q to int" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2817,10 +2784,6 @@ msgstr "colour must be between 0x000000 and 0xffffff" msgid "comparison of int and uint" msgstr "comparison of int and uint" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "complex division by zero" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "complex values not supported" @@ -2924,12 +2887,7 @@ msgstr "dimensions do not match" msgid "div/mod not implemented for uint" msgstr "div/mod not implemented for uint" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "divide by zero" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "division by zero" @@ -3301,10 +3259,6 @@ msgstr "input vectors must be of equal length" msgid "inputs are not iterable" msgstr "inputs are not iterable" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int() arg 2 must be >= 2 and <= 36" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "interp is defined for 1D iterables of equal length" @@ -3442,10 +3396,6 @@ msgstr "local '%q' used before type known" msgid "local variable referenced before assignment" msgstr "local variable referenced before assignment" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "long int not supported in this build" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode not supported by peripheral" @@ -3980,10 +3930,6 @@ msgstr "sleep length must be non-negative" msgid "slice step can't be zero" msgstr "slice step can't be zero" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "slice step cannot be zero" - #: py/nativeglue.c msgid "slice unsupported" msgstr "slice unsupported" @@ -4032,10 +3978,6 @@ msgstr "" msgid "start/end indices" msgstr "start/end indices" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "step must be non-zero" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop not reachable from start" @@ -4044,10 +3986,6 @@ msgstr "stop not reachable from start" msgid "stream operation not supported" msgstr "stream operation not supported" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "string indices must be integers, not %q" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "string not supported; use bytes or bytearray" @@ -4080,10 +4018,6 @@ msgstr "syntax error in JSON" msgid "syntax error in uctypes descriptor" msgstr "syntax error in uctypes descriptor" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() takes a 9-sequence" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4365,10 +4299,6 @@ msgstr "xTaskCreate failed" msgid "y value out of bounds" msgstr "y value out of bounds" -#: py/objrange.c -msgid "zero step" -msgstr "zero step" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi must be an ndarray" @@ -4381,6 +4311,55 @@ 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 "%q length must be >= 1" +#~ msgstr "%q length must be >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q must be a string" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "At most %d %q may be specified (not %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Invalid pins" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "No more than %d HID devices allowed" + +#~ msgid "byteorder is not a string" +#~ msgstr "Byteorder is not a string" + +#~ msgid "can't convert %q to int" +#~ msgstr "can't convert %q to int" + +#~ msgid "complex division by zero" +#~ msgstr "complex division by zero" + +#~ msgid "divide by zero" +#~ msgstr "divide by zero" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "int() arg 2 must be >= 2 and <= 36" + +#~ msgid "long int not supported in this build" +#~ msgstr "long int not supported in this build" + +#~ msgid "slice step cannot be zero" +#~ msgstr "slice step cannot be zero" + +#~ msgid "step must be non-zero" +#~ msgstr "step must be non-zero" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "string indices must be integers, not %q" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() takes a 9-sequence" + +#~ msgid "zero step" +#~ msgstr "zero step" + #~ msgid "invalid traceback" #~ msgstr "invalid traceback" diff --git a/locale/es.po b/locale/es.po index 4111331bba..4c78717f8f 100644 --- a/locale/es.po +++ b/locale/es.po @@ -130,7 +130,7 @@ msgstr "%q inicializado fallido" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q tamaño debe ser %d" @@ -146,10 +146,6 @@ msgstr "%q tamaño debe ser <= %d" msgid "%q length must be >= %d" msgstr "%q tamaño debe ser >= %d" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "%q tamaño debe ser >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q debe ser %d" @@ -175,15 +171,7 @@ msgstr "%q debe ser >= %d" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q debe ser una cadena" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -213,8 +201,8 @@ msgstr "%q fuera de rango" msgid "%q pin invalid" msgstr "pin inválido %q" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -525,10 +513,6 @@ msgstr "El array debe contener medias palabras (escriba 'H')" msgid "Array values should be single bytes." msgstr "Valores del array deben ser bytes individuales." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Como máximo %d %q se puede especificar (no %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1294,10 +1278,6 @@ msgstr "Acceso a memoria no válido." msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "pines inválidos" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Tamaño incorrecto" @@ -1539,11 +1519,6 @@ msgstr "No se especificó ninguna llave" msgid "No long integer support" msgstr "No hay soporte de entero largo" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "No se permiten más de %d dispositivos HID permitidos" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "No hay una red con ese ssid" @@ -2615,10 +2590,6 @@ msgstr "buffer demasiado pequeño" msgid "buffer too small for requested bytes" msgstr "búfer muy pequeño para los bytes solicitados" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "byteorder no es una cadena" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "el tamaño en bytes no es un múltiplo del tamaño del item" @@ -2660,14 +2631,10 @@ msgstr "no se puede asignar a la expresión" msgid "can't cancel self" msgstr "no se puede cancelar a si mismo" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "no puede convertir %q a %q" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "no se puede convertir %q a int" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2856,10 +2823,6 @@ msgstr "color debe estar entre 0x000000 y 0xffffff" msgid "comparison of int and uint" msgstr "comparación entre int y uint" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "división compleja por cero" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "valores complejos no soportados" @@ -2964,12 +2927,7 @@ msgstr "las dimensiones no concuerdan" msgid "div/mod not implemented for uint" msgstr "div/mod no implementado para uint" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "divide por cero" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "división por cero" @@ -3341,10 +3299,6 @@ msgstr "los vectores de entrada deben ser de igual tamaño" msgid "inputs are not iterable" msgstr "Entradas no son iterables" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int() arg 2 debe ser >= 2 y <= 36" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "interp está definido para iterables 1D de igual tamaño" @@ -3485,10 +3439,6 @@ msgstr "variable local '%q' usada antes del tipo conocido" msgid "local variable referenced before assignment" msgstr "variable local referenciada antes de la asignación" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "long int no soportado en esta compilación" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "Loopback + modo silencioso no están soportados por periférico" @@ -4027,10 +3977,6 @@ msgstr "la longitud de sleep no puede ser negativa" msgid "slice step can't be zero" msgstr "el tamaño de la división no puede ser cero" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "slice step no puede ser cero" - #: py/nativeglue.c msgid "slice unsupported" msgstr "sin capacidades para rebanado" @@ -4079,10 +4025,6 @@ msgstr "" msgid "start/end indices" msgstr "índices inicio/final" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "paso debe ser numero no cero" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop no se puede alcanzar del principio" @@ -4091,10 +4033,6 @@ msgstr "stop no se puede alcanzar del principio" msgid "stream operation not supported" msgstr "operación stream no soportada" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "índices de cadena deben ser enteros, no %q" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "string no soportado; usa bytes o bytearray" @@ -4127,10 +4065,6 @@ msgstr "error de sintaxis en JSON" msgid "syntax error in uctypes descriptor" msgstr "error de sintaxis en el descriptor uctypes" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() toma un sequencio 9" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4413,10 +4347,6 @@ msgstr "fallo en xTaskCreate" msgid "y value out of bounds" msgstr "valor y fuera de límites" -#: py/objrange.c -msgid "zero step" -msgstr "paso cero" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi debe ser un ndarray" @@ -4429,6 +4359,55 @@ 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 "%q length must be >= 1" +#~ msgstr "%q tamaño debe ser >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q debe ser una cadena" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Como máximo %d %q se puede especificar (no %d)" + +#~ msgid "Invalid pins" +#~ msgstr "pines inválidos" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "No se permiten más de %d dispositivos HID permitidos" + +#~ msgid "byteorder is not a string" +#~ msgstr "byteorder no es una cadena" + +#~ msgid "can't convert %q to int" +#~ msgstr "no se puede convertir %q a int" + +#~ msgid "complex division by zero" +#~ msgstr "división compleja por cero" + +#~ msgid "divide by zero" +#~ msgstr "divide por cero" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "int() arg 2 debe ser >= 2 y <= 36" + +#~ msgid "long int not supported in this build" +#~ msgstr "long int no soportado en esta compilación" + +#~ msgid "slice step cannot be zero" +#~ msgstr "slice step no puede ser cero" + +#~ msgid "step must be non-zero" +#~ msgstr "paso debe ser numero no cero" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "índices de cadena deben ser enteros, no %q" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() toma un sequencio 9" + +#~ msgid "zero step" +#~ msgstr "paso cero" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q indices deben ser enteros, no %s" diff --git a/locale/fil.po b/locale/fil.po index 52230ae094..e74d2c1da3 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -119,7 +119,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -135,10 +135,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -164,15 +160,7 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -202,8 +190,8 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -514,10 +502,6 @@ msgstr "May halfwords (type 'H') dapat ang array" msgid "Array values should be single bytes." msgstr "Array values ay dapat single bytes." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1272,10 +1256,6 @@ msgstr "" msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Mali ang pins" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1513,11 +1493,6 @@ msgstr "" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2565,10 +2540,6 @@ msgstr "masyadong maliit ang buffer" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2611,14 +2582,10 @@ msgstr "hindi ma i-assign sa expression" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2807,10 +2774,6 @@ msgstr "color ay dapat mula sa 0x000000 hangang 0xffffff" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "kumplikadong dibisyon sa pamamagitan ng zero" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "kumplikadong values hindi sinusuportahan" @@ -2917,12 +2880,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "dibisyon ng zero" @@ -3295,10 +3253,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int() arg 2 ay dapat >=2 at <= 36" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3440,10 +3394,6 @@ msgstr "local '%q' ginamit bago alam ang type" msgid "local variable referenced before assignment" msgstr "local variable na reference bago na i-assign" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "long int hindi sinusuportahan sa build na ito" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3980,10 +3930,6 @@ msgstr "sleep length ay dapat hindi negatibo" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "slice step ay hindi puedeng 0" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4032,10 +3978,6 @@ msgstr "" msgid "start/end indices" msgstr "start/end indeks" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "step ay dapat hindi zero" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop hindi maabot sa simula" @@ -4044,10 +3986,6 @@ msgstr "stop hindi maabot sa simula" msgid "stream operation not supported" msgstr "stream operation hindi sinusuportahan" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "string hindi supportado; gumamit ng bytes o kaya bytearray" @@ -4080,10 +4018,6 @@ msgstr "sintaks error sa JSON" msgid "syntax error in uctypes descriptor" msgstr "may pagkakamali sa sintaks sa uctypes descriptor" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() kumukuha ng 9-sequence" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4367,10 +4301,6 @@ msgstr "" msgid "y value out of bounds" msgstr "wala sa sakop ang address" -#: py/objrange.c -msgid "zero step" -msgstr "zero step" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" @@ -4383,6 +4313,30 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Invalid pins" +#~ msgstr "Mali ang pins" + +#~ msgid "complex division by zero" +#~ msgstr "kumplikadong dibisyon sa pamamagitan ng zero" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "int() arg 2 ay dapat >=2 at <= 36" + +#~ msgid "long int not supported in this build" +#~ msgstr "long int hindi sinusuportahan sa build na ito" + +#~ msgid "slice step cannot be zero" +#~ msgstr "slice step ay hindi puedeng 0" + +#~ msgid "step must be non-zero" +#~ msgstr "step ay dapat hindi zero" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() kumukuha ng 9-sequence" + +#~ msgid "zero step" +#~ msgstr "zero step" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q indeks ay dapat integers, hindi %s" diff --git a/locale/fr.po b/locale/fr.po index 2b2ebddf8a..edfab31a58 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -130,7 +130,7 @@ msgstr "échec de l'initialisation %q" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "La longeur de %q doit être %d" @@ -146,10 +146,6 @@ msgstr "La longeur de %q doit être <= %d" msgid "%q length must be >= %d" msgstr "La longeur de %q doit être >= %d" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "La longueur de %q doit être >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q doit être %d" @@ -175,15 +171,7 @@ msgstr "%q doit être >= %d" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q doit être a bytearray ou array de type 'h', 'H', 'b', ou 'B'" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q doit être une chaîne de caractères" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q doit être un entier" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q doit être du type %q" @@ -213,9 +201,9 @@ msgstr "%q est hors de porté" msgid "%q pin invalid" msgstr "broche %q invalide" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "%q avec un identifiant de rapport à 0 doit être de longueur 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -523,10 +511,6 @@ msgstr "La matrice doit contenir des demi-mots (type 'H')" msgid "Array values should be single bytes." msgstr "Les valeurs de la matrice doivent être des octets singuliers." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Au plus %d %q peut être spécifié (pas %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1314,10 +1298,6 @@ msgstr "Accès à la mémoire invalide." msgid "Invalid multicast MAC address" msgstr "Adresse MAC multicast invalide" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Broches invalides" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Taille invalide" @@ -1559,11 +1539,6 @@ msgstr "Aucune clé n'a été spécifiée" msgid "No long integer support" msgstr "Pas de support pour chiffre entier long" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "Pas plus de %d appareils HID autorisés" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "Aucun réseau avec ce ssid" @@ -2647,10 +2622,6 @@ msgstr "tampon trop petit" msgid "buffer too small for requested bytes" msgstr "tampon trop petit pour le nombre d'octets demandé" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "byteorder n'est pas une chaîne" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "bytes length n'est pas un multiple de la taille d'un élément" @@ -2693,14 +2664,10 @@ msgstr "ne peut pas assigner à une expression" msgid "can't cancel self" msgstr "ne peut pas s'annuler soi-même" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "impossible de convertir %q en %q" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "ne peut convertir %q à int" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2893,10 +2860,6 @@ msgstr "la couleur doit être entre 0x000000 et 0xffffff" msgid "comparison of int and uint" msgstr "comparaison entre int et uint" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "division complexe par zéro" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "valeurs complexes non supportées" @@ -3002,12 +2965,7 @@ msgstr "les dimensions ne correspondent pas" msgid "div/mod not implemented for uint" msgstr "div/mod ne sont pas implémentés pour uint" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "division par zéro" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "division par zéro" @@ -3382,10 +3340,6 @@ msgstr "les vecteurs d'entrée doivent être de longueur égale" msgid "inputs are not iterable" msgstr "les entrées ne sont pas itérables" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "Le deuxième argument de int() doit être compris entre 2 et 36 inclus" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "interp n'est défini que pour les 1D itérables de taille identique" @@ -3529,10 +3483,6 @@ msgstr "variable locale '%q' utilisée avant d'en connaitre le type" msgid "local variable referenced before assignment" msgstr "variable locale référencée avant d'être assignée" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "entiers longs non supportés dans cette build" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode non pris en charge par le périphérique" @@ -4072,10 +4022,6 @@ msgstr "la longueur de sleep ne doit pas être négative" msgid "slice step can't be zero" msgstr "le pas 'step' de la tranche ne peut être zéro" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "le pas 'step' de la tranche ne peut être zéro" - #: py/nativeglue.c msgid "slice unsupported" msgstr "slice non-supporté" @@ -4124,10 +4070,6 @@ msgstr "source_bitmap doit avoir une value_count de 8" msgid "start/end indices" msgstr "indices de début/fin" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "le pas 'step' doit être non nul" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop n'est pas accessible au démarrage" @@ -4136,10 +4078,6 @@ msgstr "stop n'est pas accessible au démarrage" msgid "stream operation not supported" msgstr "opération de flux non supportée" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "les indices d'une chaîne doivent être des entiers, pas %q" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4173,10 +4111,6 @@ msgstr "erreur de syntaxe JSON" msgid "syntax error in uctypes descriptor" msgstr "erreur de syntaxe dans le descripteur d'uctypes" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() prend une séquence de longueur 9" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4458,10 +4392,6 @@ msgstr "Échec de xTaskCreate" msgid "y value out of bounds" msgstr "valeur y hors limites" -#: py/objrange.c -msgid "zero step" -msgstr "'step' nul" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi doit être un ndarray" @@ -4474,6 +4404,62 @@ 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 "%q length must be >= 1" +#~ msgstr "La longueur de %q doit être >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q doit être une chaîne de caractères" + +#~ msgid "%q must be an int" +#~ msgstr "%q doit être un entier" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "%q avec un identifiant de rapport à 0 doit être de longueur 1" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Au plus %d %q peut être spécifié (pas %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Broches invalides" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "Pas plus de %d appareils HID autorisés" + +#~ msgid "byteorder is not a string" +#~ msgstr "byteorder n'est pas une chaîne" + +#~ msgid "can't convert %q to int" +#~ msgstr "ne peut convertir %q à int" + +#~ msgid "complex division by zero" +#~ msgstr "division complexe par zéro" + +#~ msgid "divide by zero" +#~ msgstr "division par zéro" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "" +#~ "Le deuxième argument de int() doit être compris entre 2 et 36 inclus" + +#~ msgid "long int not supported in this build" +#~ msgstr "entiers longs non supportés dans cette build" + +#~ msgid "slice step cannot be zero" +#~ msgstr "le pas 'step' de la tranche ne peut être zéro" + +#~ msgid "step must be non-zero" +#~ msgstr "le pas 'step' doit être non nul" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "les indices d'une chaîne doivent être des entiers, pas %q" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() prend une séquence de longueur 9" + +#~ msgid "zero step" +#~ msgstr "'step' nul" + #~ msgid "invalid traceback" #~ msgstr "traceback invalide" diff --git a/locale/hi.po b/locale/hi.po index 3442078b84..7c46dfeadd 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -118,7 +118,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -134,10 +134,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -163,15 +159,7 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -201,8 +189,8 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -511,10 +499,6 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1260,10 +1244,6 @@ msgstr "" msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1501,11 +1481,6 @@ msgstr "" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2545,10 +2520,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2590,14 +2561,10 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2781,10 +2748,6 @@ msgstr "" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2887,12 +2850,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "" @@ -3264,10 +3222,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3405,10 +3359,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3943,10 +3893,6 @@ msgstr "" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -3995,10 +3941,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4007,10 +3949,6 @@ msgstr "" msgid "stream operation not supported" msgstr "" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4043,10 +3981,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4328,10 +4262,6 @@ msgstr "" msgid "y value out of bounds" msgstr "" -#: py/objrange.c -msgid "zero step" -msgstr "" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 0096ffdb40..93b911fc93 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -125,7 +125,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -141,10 +141,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -170,15 +166,7 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -208,8 +196,8 @@ msgstr "%q oltre il limite" msgid "%q pin invalid" msgstr "%q pin non valido" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -520,10 +508,6 @@ msgstr "Array deve avere mezzoparole (typo 'H')" msgid "Array values should be single bytes." msgstr "I valori dell'Array dovrebbero essere bytes singoli." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Almeno %d %q devono essere specificati (non %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1277,10 +1261,6 @@ msgstr "" msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Pin non validi" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1519,11 +1499,6 @@ msgstr "" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2577,10 +2552,6 @@ msgstr "buffer troppo piccolo" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2623,14 +2594,10 @@ msgstr "impossibile assegnare all'espressione" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, fuzzy, c-format msgid "can't convert %s to complex" @@ -2816,10 +2783,6 @@ msgstr "il colore deve essere compreso tra 0x000000 e 0xffffff" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "complex divisione per zero" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "valori complessi non supportai" @@ -2925,12 +2888,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "divisione per zero" @@ -3303,10 +3261,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3449,10 +3403,6 @@ msgstr "locla '%q' utilizzato prima che il tipo fosse noto" msgid "local variable referenced before assignment" msgstr "variabile locale richiamata prima di un assegnamento" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "long int non supportata in questa build" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3993,10 +3943,6 @@ msgstr "la lunghezza di sleed deve essere non negativa" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "la step della slice non può essere zero" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4045,10 +3991,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "step deve essere non zero" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop non raggiungibile dall'inizio" @@ -4057,10 +3999,6 @@ msgstr "stop non raggiungibile dall'inizio" msgid "stream operation not supported" msgstr "operazione di stream non supportata" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4093,10 +4031,6 @@ msgstr "errore di sintassi nel JSON" msgid "syntax error in uctypes descriptor" msgstr "errore di sintassi nel descrittore uctypes" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4380,10 +4314,6 @@ msgstr "" msgid "y value out of bounds" msgstr "indirizzo fuori limite" -#: py/objrange.c -msgid "zero step" -msgstr "zero step" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" @@ -4396,6 +4326,30 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Almeno %d %q devono essere specificati (non %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Pin non validi" + +#~ msgid "complex division by zero" +#~ msgstr "complex divisione per zero" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" + +#~ msgid "long int not supported in this build" +#~ msgstr "long int non supportata in questa build" + +#~ msgid "slice step cannot be zero" +#~ msgstr "la step della slice non può essere zero" + +#~ msgid "step must be non-zero" +#~ msgstr "step deve essere non zero" + +#~ msgid "zero step" +#~ msgstr "zero step" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "gli indici %q devono essere interi, non %s" diff --git a/locale/ja.po b/locale/ja.po index 226f0d33a1..637482c9f1 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -123,7 +123,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -139,10 +139,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -168,15 +164,7 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -206,8 +194,8 @@ msgstr "%q が範囲外" msgid "%q pin invalid" msgstr "%q ピンは無効" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -516,10 +504,6 @@ msgstr "array のタイプは16ビット ('H') でなければなりません" msgid "Array values should be single bytes." msgstr "Arrayの各値は1バイトでなければなりません" -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "最大で %d個の %q が指定できます(%d個でなく)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1271,10 +1255,6 @@ msgstr "不正なメモリアクセス" msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "ピンが不正" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1512,11 +1492,6 @@ msgstr "キーが指定されていません" msgid "No long integer support" msgstr "long integerに対応していません" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2559,10 +2534,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "byteorderが文字列ではありません" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2604,14 +2575,10 @@ msgstr "式には代入できません" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "%qを%qに変換できません" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2797,10 +2764,6 @@ msgstr "色は0x000000から0xffffffでなければなりません" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "複素数ゼロ除算" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2905,12 +2868,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "ゼロ除算 (division by zero)" @@ -3283,10 +3241,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int()の第2引数は2以上36以下でなければなりません" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3424,10 +3378,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "このビルドはlong intに非対応" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3964,10 +3914,6 @@ msgstr "sleepの長さは非負数でなければなりません" msgid "slice step can't be zero" msgstr "スライスのステップは0にできません" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4016,10 +3962,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "stepは非ゼロ値でなければなりません" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4028,10 +3970,6 @@ msgstr "" msgid "stream operation not supported" msgstr "ストリーム操作は非対応" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "文字列のインデクスは整数でなければなりません (%qでなく)" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "文字列ではなくbytesまたはbytesarrayが必要" @@ -4064,10 +4002,6 @@ msgstr "JSONに構文エラーがあります" msgid "syntax error in uctypes descriptor" msgstr "uctypedディスクリプタの構文エラー" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time()は9要素のシーケンスを受け取ります" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4349,10 +4283,6 @@ msgstr "" msgid "y value out of bounds" msgstr "yが範囲外" -#: py/objrange.c -msgid "zero step" -msgstr "ステップが0" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "ziはndarrayでなければなりません" @@ -4365,6 +4295,36 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "最大で %d個の %q が指定できます(%d個でなく)" + +#~ msgid "Invalid pins" +#~ msgstr "ピンが不正" + +#~ msgid "byteorder is not a string" +#~ msgstr "byteorderが文字列ではありません" + +#~ msgid "complex division by zero" +#~ msgstr "複素数ゼロ除算" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "int()の第2引数は2以上36以下でなければなりません" + +#~ msgid "long int not supported in this build" +#~ msgstr "このビルドはlong intに非対応" + +#~ msgid "step must be non-zero" +#~ msgstr "stepは非ゼロ値でなければなりません" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "文字列のインデクスは整数でなければなりません (%qでなく)" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time()は9要素のシーケンスを受け取ります" + +#~ msgid "zero step" +#~ msgstr "ステップが0" + #~ msgid "WatchDogTimer.timeout must be greater than 0" #~ msgstr "WatchDogTimer.timeoutは0以上でなければなりません" diff --git a/locale/ko.po b/locale/ko.po index 9f192a7a50..be6a478270 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -119,7 +119,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -135,10 +135,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -164,15 +160,7 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -202,8 +190,8 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -512,10 +500,6 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1263,10 +1247,6 @@ msgstr "" msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "핀이 유효하지 않습니다" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1504,11 +1484,6 @@ msgstr "" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2549,10 +2524,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2594,14 +2565,10 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2785,10 +2752,6 @@ msgstr "" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2891,12 +2854,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "" @@ -3268,10 +3226,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3409,10 +3363,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3947,10 +3897,6 @@ msgstr "" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -3999,10 +3945,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4011,10 +3953,6 @@ msgstr "" msgid "stream operation not supported" msgstr "" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4047,10 +3985,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4332,10 +4266,6 @@ msgstr "" msgid "y value out of bounds" msgstr "" -#: py/objrange.c -msgid "zero step" -msgstr "" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" @@ -4348,6 +4278,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Invalid pins" +#~ msgstr "핀이 유효하지 않습니다" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" diff --git a/locale/nl.po b/locale/nl.po index eff8d7e5f9..bade0bb402 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -121,7 +121,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -137,10 +137,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -166,15 +162,7 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -204,8 +192,8 @@ msgstr "%q buiten bereik" msgid "%q pin invalid" msgstr "%q pin onjuist" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -514,10 +502,6 @@ msgstr "Array moet halfwords (type 'H') bevatten" msgid "Array values should be single bytes." msgstr "Array waardes moet enkele bytes zijn." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Op zijn meest %d %q mogen worden gespecificeerd (niet %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1271,10 +1255,6 @@ msgstr "Ongeldig geheugen adres." msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Ongeldige pinnen" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1512,11 +1492,6 @@ msgstr "Een sleutel was niet gespecificeerd" msgid "No long integer support" msgstr "Geen lange integer ondersteuning" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "Geen netwerk met dat SSID gevonden" @@ -2575,10 +2550,6 @@ msgstr "buffer te klein" msgid "buffer too small for requested bytes" msgstr "buffer te klein voor gevraagde bytes" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "byteorder is geen string" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "bytes lengte is geen veelvoud van itemgrootte" @@ -2621,14 +2592,10 @@ msgstr "kan niet toewijzen aan expressie" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "kan %q niet naar %q converteren" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2812,10 +2779,6 @@ msgstr "kleur moet tussen 0x000000 en 0xffffff liggen" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "complexe deling door 0" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "complexe waardes niet ondersteund" @@ -2920,12 +2883,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "deling door nul" @@ -3298,10 +3256,6 @@ msgstr "invoervectors moeten van gelijke lengte zijn" msgid "inputs are not iterable" msgstr "invoer is niet itereerbaar" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int() argument 2 moet >=2 en <= 36 zijn" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3442,10 +3396,6 @@ msgstr "lokale '%q' gebruikt voordat type bekend is" msgid "local variable referenced before assignment" msgstr "verwijzing naar een (nog) niet toegewezen lokale variabele" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "long int wordt niet ondersteund in deze build" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode wordt niet ondersteund door randapparaat" @@ -3980,10 +3930,6 @@ msgstr "de slaapduur mag niet negatief zijn" msgid "slice step can't be zero" msgstr "segmentstap mag niet nul zijn" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "segmentstap mag niet nul zijn" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4032,10 +3978,6 @@ msgstr "" msgid "start/end indices" msgstr "start/stop indices" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "step mag geen nul zijn" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop is niet bereikbaar vanaf start" @@ -4044,10 +3986,6 @@ msgstr "stop is niet bereikbaar vanaf start" msgid "stream operation not supported" msgstr "stream operatie niet ondersteund" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "string indices moeten integers zijn, geen %q" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "string niet ondersteund; gebruik bytes of bytearray" @@ -4080,10 +4018,6 @@ msgstr "syntaxisfout in JSON" msgid "syntax error in uctypes descriptor" msgstr "syntaxisfout in uctypes aanduiding" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() accepteert een 9-rij" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4365,10 +4299,6 @@ msgstr "" msgid "y value out of bounds" msgstr "y-waarde buiten bereik" -#: py/objrange.c -msgid "zero step" -msgstr "nul-stap" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi moet een ndarray zijn" @@ -4381,6 +4311,39 @@ 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 "At most %d %q may be specified (not %d)" +#~ msgstr "Op zijn meest %d %q mogen worden gespecificeerd (niet %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Ongeldige pinnen" + +#~ msgid "byteorder is not a string" +#~ msgstr "byteorder is geen string" + +#~ msgid "complex division by zero" +#~ msgstr "complexe deling door 0" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "int() argument 2 moet >=2 en <= 36 zijn" + +#~ msgid "long int not supported in this build" +#~ msgstr "long int wordt niet ondersteund in deze build" + +#~ msgid "slice step cannot be zero" +#~ msgstr "segmentstap mag niet nul zijn" + +#~ msgid "step must be non-zero" +#~ msgstr "step mag geen nul zijn" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "string indices moeten integers zijn, geen %q" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() accepteert een 9-rij" + +#~ msgid "zero step" +#~ msgstr "nul-stap" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q indexen moeten integers zijn, niet %s" diff --git a/locale/pl.po b/locale/pl.po index 7d7085a2c0..76227fef54 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -123,7 +123,7 @@ msgstr "" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -139,10 +139,6 @@ msgstr "" msgid "%q length must be >= %d" msgstr "" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "" - #: py/argcheck.c msgid "%q must be %d" msgstr "" @@ -168,15 +164,7 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "" @@ -206,8 +194,8 @@ msgstr "%q poza zakresem" msgid "%q pin invalid" msgstr "nieprawidłowy pin %q" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" msgstr "" #: py/bc.c py/objnamedtuple.c @@ -516,10 +504,6 @@ msgstr "Tablica musi zawierać pół-słowa (typ 'H')" msgid "Array values should be single bytes." msgstr "Wartości powinny być bajtami." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1271,10 +1255,6 @@ msgstr "Nieprawidłowy dostęp do pamięci." msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Złe nóżki" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Nieprawidłowy rozmiar" @@ -1512,11 +1492,6 @@ msgstr "Nie określono klucza" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2556,10 +2531,6 @@ msgstr "zbyt mały bufor" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2601,14 +2572,10 @@ msgstr "przypisanie do wyrażenia" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "nie można dokonać konwersji %q na %q" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2792,10 +2759,6 @@ msgstr "kolor musi być pomiędzy 0x000000 a 0xffffff" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "zespolone dzielenie przez zero" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "wartości zespolone nieobsługiwane" @@ -2899,12 +2862,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "dzielenie przez zero" @@ -3276,10 +3234,6 @@ msgstr "wektory wejściowe muszą być równej długości" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "argument 2 do int() busi być pomiędzy 2 a 36" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3417,10 +3371,6 @@ msgstr "local '%q' użyty zanim typ jest znany" msgid "local variable referenced before assignment" msgstr "zmienna lokalna użyta przed przypisaniem" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "long int jest nieobsługiwany" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3956,10 +3906,6 @@ msgstr "okres snu musi być nieujemny" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "zerowy krok" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4008,10 +3954,6 @@ msgstr "" msgid "start/end indices" msgstr "początkowe/końcowe indeksy" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "step nie może być zerowe" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop nie jest osiągalne ze start" @@ -4020,10 +3962,6 @@ msgstr "stop nie jest osiągalne ze start" msgid "stream operation not supported" msgstr "operacja na strumieniu nieobsługiwana" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "łańcuchy nieobsługiwane; użyj bytes lub bytearray" @@ -4056,10 +3994,6 @@ msgstr "błąd składni w JSON" msgid "syntax error in uctypes descriptor" msgstr "błąd składni w deskryptorze uctypes" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() wymaga 9-elementowej sekwencji" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4341,10 +4275,6 @@ msgstr "" msgid "y value out of bounds" msgstr "y poza zakresem" -#: py/objrange.c -msgid "zero step" -msgstr "zerowy krok" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" @@ -4357,6 +4287,30 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Invalid pins" +#~ msgstr "Złe nóżki" + +#~ msgid "complex division by zero" +#~ msgstr "zespolone dzielenie przez zero" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "argument 2 do int() busi być pomiędzy 2 a 36" + +#~ msgid "long int not supported in this build" +#~ msgstr "long int jest nieobsługiwany" + +#~ msgid "slice step cannot be zero" +#~ msgstr "zerowy krok" + +#~ msgid "step must be non-zero" +#~ msgstr "step nie może być zerowe" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() wymaga 9-elementowej sekwencji" + +#~ msgid "zero step" +#~ msgstr "zerowy krok" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q indeks musi być liczbą całkowitą, a nie %s" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 979b7c632a..e768c6310e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -127,7 +127,7 @@ msgstr "a inicialização do %q falhou" msgid "%q is %q" msgstr "%q é %q" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "O comprimento de %q deve ser %d" @@ -143,10 +143,6 @@ msgstr "o comprimento de %q deve ser <= %d" msgid "%q length must be >= %d" msgstr "o comprimento de %q deve ser >= %d" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "o comprimento %q deve ser >=1" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q deve ser %d" @@ -172,15 +168,7 @@ msgstr "o %q deve ser >= %d" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q deve ser um bytearray ou uma matriz do tipo 'h', 'H', 'b', ou 'B'" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q deve ser uma string" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q deve ser um inteiro" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q deve ser do tipo %q" @@ -210,9 +198,9 @@ msgstr "%q fora do alcance" msgid "%q pin invalid" msgstr "%q pino inválido" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "%q com um relatório com ID de 0 deve ter comprimento 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -524,10 +512,6 @@ msgstr "Array deve conter meias palavras (tipo 'H')" msgid "Array values should be single bytes." msgstr "Os valores das matrizes devem ser bytes simples." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Pelo menos %d %q pode ser definido (não %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1299,10 +1283,6 @@ msgstr "O acesso da memória é inválido." msgid "Invalid multicast MAC address" msgstr "Endereço MAC multicast inválido" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Pinos inválidos" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Tamanho inválido" @@ -1540,11 +1520,6 @@ msgstr "Nenhuma chave foi definida" msgid "No long integer support" msgstr "Não há compatibilidade com inteiro longo" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "Não são permitidos mais do que %d dispositivos HID" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "Não há rede com este ssid" @@ -2628,10 +2603,6 @@ msgstr "o buffer é muito pequeno" msgid "buffer too small for requested bytes" msgstr "o buffer é pequeno demais para os bytes requisitados" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "a ordem dos bytes não é uma cadeia de caracteres" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "o comprimento dos bytes não é um múltiplo do tamanho do item" @@ -2673,14 +2644,10 @@ msgstr "a expressão não pode ser atribuída" msgid "can't cancel self" msgstr "não é possível cancelar a si mesmo" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "não é possível converter %q para %q" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "Não é possível converter %q para int" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2870,10 +2837,6 @@ msgstr "cor deve estar entre 0x000000 e 0xffffff" msgid "comparison of int and uint" msgstr "comparação de int e uint" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "divisão complexa por zero" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "os valores complexos não compatíveis" @@ -2979,12 +2942,7 @@ msgstr "as dimensões não coincidem" msgid "div/mod not implemented for uint" msgstr "div/mod não implementado para uint" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "divido por zero" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "divisão por zero" @@ -3359,10 +3317,6 @@ msgstr "os vetores da entrada devem ter o mesmo comprimento" msgid "inputs are not iterable" msgstr "as entradas não são iteráveis" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int() arg 2 deve ser >= 2 e <= 36" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "o interp é definido para iteráveis 1D com comprimento igual" @@ -3503,10 +3457,6 @@ msgstr "o local '%q' usado antes do tipo conhecido" msgid "local variable referenced before assignment" msgstr "a variável local referenciada antes da atribuição" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "o long int não é suportado nesta compilação" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "o loopback + o modo silencioso não é suportado pelo periférico" @@ -4048,10 +3998,6 @@ msgstr "a duração do sleep não deve ser negativo" msgid "slice step can't be zero" msgstr "a etapa da fatia não pode ser zero" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "a etapa da fatia não pode ser zero" - #: py/nativeglue.c msgid "slice unsupported" msgstr "fatia não suportada" @@ -4100,10 +4046,6 @@ msgstr "o source_bitmap deve ter o value_count de 8" msgid "start/end indices" msgstr "os índices de início/fim" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "o passo deve ser diferente de zero" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop não está acessível a partir do início" @@ -4112,10 +4054,6 @@ msgstr "stop não está acessível a partir do início" msgid "stream operation not supported" msgstr "a operação do fluxo não é compatível" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "a sequência dos índices devem ser inteiros, não %q" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "a string não é compatível; use bytes ou bytearray" @@ -4148,10 +4086,6 @@ msgstr "erro de sintaxe no JSON" msgid "syntax error in uctypes descriptor" msgstr "houve um erro de sintaxe no descritor uctypes" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() leva uma sequência com 9" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4433,10 +4367,6 @@ msgstr "o xTaskCreate falhou" msgid "y value out of bounds" msgstr "o valor y está fora dos limites" -#: py/objrange.c -msgid "zero step" -msgstr "passo zero" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi deve ser um ndarray" @@ -4449,6 +4379,61 @@ 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 "%q length must be >= 1" +#~ msgstr "o comprimento %q deve ser >=1" + +#~ msgid "%q must be a string" +#~ msgstr "%q deve ser uma string" + +#~ msgid "%q must be an int" +#~ msgstr "%q deve ser um inteiro" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "%q com um relatório com ID de 0 deve ter comprimento 1" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Pelo menos %d %q pode ser definido (não %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Pinos inválidos" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "Não são permitidos mais do que %d dispositivos HID" + +#~ msgid "byteorder is not a string" +#~ msgstr "a ordem dos bytes não é uma cadeia de caracteres" + +#~ msgid "can't convert %q to int" +#~ msgstr "Não é possível converter %q para int" + +#~ msgid "complex division by zero" +#~ msgstr "divisão complexa por zero" + +#~ msgid "divide by zero" +#~ msgstr "divido por zero" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "int() arg 2 deve ser >= 2 e <= 36" + +#~ msgid "long int not supported in this build" +#~ msgstr "o long int não é suportado nesta compilação" + +#~ msgid "slice step cannot be zero" +#~ msgstr "a etapa da fatia não pode ser zero" + +#~ msgid "step must be non-zero" +#~ msgstr "o passo deve ser diferente de zero" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "a sequência dos índices devem ser inteiros, não %q" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() leva uma sequência com 9" + +#~ msgid "zero step" +#~ msgstr "passo zero" + #~ msgid "invalid traceback" #~ msgstr "rastreamento inválido" diff --git a/locale/ru.po b/locale/ru.po index 82b2965ead..4e16f66535 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -129,7 +129,7 @@ msgstr "Инициализация %q не удалась" msgid "%q is %q" msgstr "%q является %q" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "Длинна %q должна быть %d" @@ -145,10 +145,6 @@ msgstr "Длинна %q должна быть <= %d" msgid "%q length must be >= %d" msgstr "Длинна %q должна быть >= %d" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "Длинна %q должна быть >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q должно быть %d" @@ -174,15 +170,7 @@ msgstr "%q должно быть >= %d" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q должно быть bytearray или array типа 'h', 'H', 'b', или 'B'" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q должно быть строкой" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q должно быть int" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q должно быть типа %q" @@ -212,9 +200,9 @@ msgstr "%q вне диапазона" msgid "%q pin invalid" msgstr "Пин %q не допустим" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "%q с идентификатором отчёта 0 должен иметь длину 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -522,10 +510,6 @@ msgstr "Массив должен содержать полуслова (тип msgid "Array values should be single bytes." msgstr "Значения массива должны быть однобайтовыми." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Может быть указано не более %d %q (не %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1308,10 +1292,6 @@ msgstr "Неправильный доступ к памяти." msgid "Invalid multicast MAC address" msgstr "Неверный MAC-адрес multicast" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Недопустимые пины" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Неверный размер" @@ -1552,11 +1532,6 @@ msgstr "Ключ не был указан" msgid "No long integer support" msgstr "Нет поддержки длинных целых чисел (long integer)" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "Допускается не более %d HID устройств" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "Нет сети с этим ssid" @@ -2613,10 +2588,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2658,14 +2629,10 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2849,10 +2816,6 @@ msgstr "" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2955,12 +2918,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "" @@ -3332,10 +3290,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3473,10 +3427,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -4011,10 +3961,6 @@ msgstr "" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4063,10 +4009,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4075,10 +4017,6 @@ msgstr "" msgid "stream operation not supported" msgstr "" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4111,10 +4049,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4396,10 +4330,6 @@ msgstr "" msgid "y value out of bounds" msgstr "" -#: py/objrange.c -msgid "zero step" -msgstr "" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" @@ -4412,6 +4342,28 @@ msgstr "zi должно быть типа float" msgid "zi must be of shape (n_section, 2)" msgstr "zi должен иметь форму (n_section, 2)" +#~ msgid "%q length must be >= 1" +#~ msgstr "Длинна %q должна быть >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q должно быть строкой" + +#~ msgid "%q must be an int" +#~ msgstr "%q должно быть int" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "%q с идентификатором отчёта 0 должен иметь длину 1" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Может быть указано не более %d %q (не %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Недопустимые пины" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "Допускается не более %d HID устройств" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "Индексы %q должны быть целыми числами, а не %s" diff --git a/locale/sv.po b/locale/sv.po index fd715cfc13..edb16acdd8 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -126,7 +126,7 @@ msgstr "%q init misslyckades" msgid "%q is %q" msgstr "%q är %q" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "längden på %q måste vara %d" @@ -142,10 +142,6 @@ msgstr "längden på %q måste vara <= %d" msgid "%q length must be >= %d" msgstr "längden på %q måste vara >= %d" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "längden på %q måste vara >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q måste vara %d" @@ -173,15 +169,7 @@ msgstr "" "%q måste vara en bytearray eller en array av typen \"h\", \"H\", \"b\" eller " "\"B\"" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q måste vara en sträng" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q måste vara en int" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q måste vara av typen %q" @@ -211,9 +199,9 @@ msgstr "%q utanför intervallet" msgid "%q pin invalid" msgstr "Pinne %q ogiltig" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "%q med report-ID 0 måste ha längd 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -521,10 +509,6 @@ msgstr "Matrisen måste innehålla halfwords (typ \"H\")" msgid "Array values should be single bytes." msgstr "Matrisvärden ska bestå av enstaka bytes." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "Högst %d %q kan anges (inte %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1283,10 +1267,6 @@ msgstr "Ogiltig minnesåtkomst." msgid "Invalid multicast MAC address" msgstr "Ogiltig MAC-adress för multicast" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Ogiltiga pinnar" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Ogiltig storlek" @@ -1525,11 +1505,6 @@ msgstr "Ingen nyckel angavs" msgid "No long integer support" msgstr "Inget stöd för långt heltal" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "Högst %d HID-enheter är tillåtna" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "Inget nätverk med sådant ssid" @@ -2601,10 +2576,6 @@ msgstr "buffert för liten" msgid "buffer too small for requested bytes" msgstr "buffert för liten för begärd längd" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "byteorder är inte en sträng" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "bytelängd inte en multipel av storlek" @@ -2646,14 +2617,10 @@ msgstr "kan inte tilldela uttryck" msgid "can't cancel self" msgstr "kan inte avbryta sig själv" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "kan inte konvertera %q till %q" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "kan inte konvertera %q till int" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2839,10 +2806,6 @@ msgstr "färg måste vara mellan 0x000000 och 0xffffff" msgid "comparison of int and uint" msgstr "jämförelse av int och uint" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "komplex division med noll" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "komplexa värden stöds inte" @@ -2948,12 +2911,7 @@ msgstr "dimensioner matchar inte" msgid "div/mod not implemented for uint" msgstr "div/mod inte implementerat för uint" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "division med noll" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "division med noll" @@ -3327,10 +3285,6 @@ msgstr "indatavektorer måste ha samma längd" msgid "inputs are not iterable" msgstr "indata är inte iterbara" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int() arg 2 måste vara >= 2 och <= 36" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "interp är definierad för 1D-iterabla med samma längd" @@ -3471,10 +3425,6 @@ msgstr "lokal '%q' används innan typen är känd" msgid "local variable referenced before assignment" msgstr "lokal variabel refererad före tilldelning" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "long int stöds inte i denna build" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + tyst läge stöds inte av kringutrustning" @@ -4010,10 +3960,6 @@ msgstr "värdet för sleep måste vara positivt" msgid "slice step can't be zero" msgstr "segmentsteg kan inte vara noll" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "segmentsteg kan inte vara noll" - #: py/nativeglue.c msgid "slice unsupported" msgstr "slice stöds inte" @@ -4062,10 +4008,6 @@ msgstr "source_bitmap måste ha value_count av 8" msgid "start/end indices" msgstr "start-/slutindex" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "step måste vara icke-noll" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop kan inte nås från start" @@ -4074,10 +4016,6 @@ msgstr "stop kan inte nås från start" msgid "stream operation not supported" msgstr "stream-åtgärd stöds inte" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "strängindex måste vara heltal, inte %q" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "sträng stöds inte; använd bytes eller bytearray" @@ -4110,10 +4048,6 @@ msgstr "syntaxfel i JSON" msgid "syntax error in uctypes descriptor" msgstr "syntaxfel i uctypes deskriptor" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() kräver en 9-sekvens" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4395,10 +4329,6 @@ msgstr "xTaskCreate misslyckades" msgid "y value out of bounds" msgstr "y-värde utanför intervall" -#: py/objrange.c -msgid "zero step" -msgstr "noll steg" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi måste vara en ndarray" @@ -4411,6 +4341,61 @@ 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 "%q length must be >= 1" +#~ msgstr "längden på %q måste vara >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q måste vara en sträng" + +#~ msgid "%q must be an int" +#~ msgstr "%q måste vara en int" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "%q med report-ID 0 måste ha längd 1" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "Högst %d %q kan anges (inte %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Ogiltiga pinnar" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "Högst %d HID-enheter är tillåtna" + +#~ msgid "byteorder is not a string" +#~ msgstr "byteorder är inte en sträng" + +#~ msgid "can't convert %q to int" +#~ msgstr "kan inte konvertera %q till int" + +#~ msgid "complex division by zero" +#~ msgstr "komplex division med noll" + +#~ msgid "divide by zero" +#~ msgstr "division med noll" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "int() arg 2 måste vara >= 2 och <= 36" + +#~ msgid "long int not supported in this build" +#~ msgstr "long int stöds inte i denna build" + +#~ msgid "slice step cannot be zero" +#~ msgstr "segmentsteg kan inte vara noll" + +#~ msgid "step must be non-zero" +#~ msgstr "step måste vara icke-noll" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "strängindex måste vara heltal, inte %q" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() kräver en 9-sekvens" + +#~ msgid "zero step" +#~ msgstr "noll steg" + #~ msgid "invalid traceback" #~ msgstr "Ogilitig källspårning" diff --git a/locale/tr.po b/locale/tr.po index 858e0ba4b3..3d78a8c0f9 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -130,7 +130,7 @@ msgstr "%q init başarısız oldu" msgid "%q is %q" msgstr "" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q boyutu %d olmalıdır" @@ -146,10 +146,6 @@ msgstr "%q boyutu <= %d olmalıdır" msgid "%q length must be >= %d" msgstr "%q boyutu >= %d olmalıdır" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "%q boyutu >=1 olmalıdır" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q, %d olmalıdır" @@ -175,15 +171,7 @@ msgstr "%q >= %d olmalıdır" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q 'h', 'H', 'b' yada 'B' tipi bir bytearray /array olmalı" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q bir string olmalıdır" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q bir tam sayı olmalıdır" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q, %q türünde olmalıdır" @@ -213,9 +201,9 @@ msgstr "%q aralık dışında" msgid "%q pin invalid" msgstr "%q pini geçersiz" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "Rapor kimliği 0 olan %q, 1 uzunluğunda olmalıdır" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -524,10 +512,6 @@ msgstr "Dizi yarımsözcüklere sahip olmalıdır (tip 'H')" msgid "Array values should be single bytes." msgstr "Dizi değerleri tekil bytelar olmalıdır." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "En az %d %q belirtilmeli (%d değil)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1277,10 +1261,6 @@ msgstr "" msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1518,11 +1498,6 @@ msgstr "" msgid "No long integer support" msgstr "" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "" @@ -2565,10 +2540,6 @@ msgstr "" msgid "buffer too small for requested bytes" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2610,14 +2581,10 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2801,10 +2768,6 @@ msgstr "" msgid "comparison of int and uint" msgstr "" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "" @@ -2907,12 +2870,7 @@ msgstr "" msgid "div/mod not implemented for uint" msgstr "" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "" @@ -3284,10 +3242,6 @@ msgstr "" msgid "inputs are not iterable" msgstr "" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3425,10 +3379,6 @@ msgstr "" msgid "local variable referenced before assignment" msgstr "" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3963,10 +3913,6 @@ msgstr "" msgid "slice step can't be zero" msgstr "" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "" - #: py/nativeglue.c msgid "slice unsupported" msgstr "" @@ -4015,10 +3961,6 @@ msgstr "" msgid "start/end indices" msgstr "" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4027,10 +3969,6 @@ msgstr "" msgid "stream operation not supported" msgstr "" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" @@ -4063,10 +4001,6 @@ msgstr "" msgid "syntax error in uctypes descriptor" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4348,10 +4282,6 @@ msgstr "" msgid "y value out of bounds" msgstr "" -#: py/objrange.c -msgid "zero step" -msgstr "" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "" @@ -4364,6 +4294,21 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q length must be >= 1" +#~ msgstr "%q boyutu >=1 olmalıdır" + +#~ msgid "%q must be a string" +#~ msgstr "%q bir string olmalıdır" + +#~ msgid "%q must be an int" +#~ msgstr "%q bir tam sayı olmalıdır" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "Rapor kimliği 0 olan %q, 1 uzunluğunda olmalıdır" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "En az %d %q belirtilmeli (%d değil)" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q indeksleri integer olmalı, %s değil" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index daa7721926..04ad1b28aa 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -129,7 +129,7 @@ msgstr "%q chūshǐhuà shībài" msgid "%q is %q" msgstr "%q shì %q" -#: py/argcheck.c +#: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q de chángdù bìxū shì %d" @@ -145,10 +145,6 @@ msgstr "%q chángdù bìxū <= %d" msgid "%q length must be >= %d" msgstr "%q chángdù bìxū >= %d" -#: shared-bindings/busio/I2C.c -msgid "%q length must be >= 1" -msgstr "%q cháng dù bìxū >= 1" - #: py/argcheck.c msgid "%q must be %d" msgstr "%q bìxū %d" @@ -175,15 +171,7 @@ msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" "%q bì xū shì zì jié shù zǔ huò lèi xíng wéi 'h', 'H', 'b', huò 'B' de shù zǔ" -#: py/argcheck.c -msgid "%q must be a string" -msgstr "%q bìxū shì yí gè zì fú chuàn" - -#: py/argcheck.c -msgid "%q must be an int" -msgstr "%q bìxū shì zhěng xíng" - -#: py/argcheck.c py/obj.c +#: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" msgstr "%q bì xū shì %q lèi xíng" @@ -213,9 +201,9 @@ msgstr "%q chāochū fànwéi" msgid "%q pin invalid" msgstr "%q yǐn jiǎo wúxiào" -#: shared-bindings/usb_hid/Device.c -msgid "%q with a report ID of 0 must be of length 1" -msgstr "bào gào ID shì 0 de %q bì xū cháng dù wéi 1" +#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c +msgid "%q step cannot be zero" +msgstr "" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -523,10 +511,6 @@ msgstr "Shùzǔ bìxū bāohán halfwords (type 'H')" msgid "Array values should be single bytes." msgstr "shùzǔ de zhí yīnggāi shì dān'gè zìjié." -#: shared-bindings/microcontroller/Pin.c -msgid "At most %d %q may be specified (not %d)" -msgstr "zuìduō kěyǐ zhǐdìng %d gè %q (érbúshì %d)" - #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -1289,10 +1273,6 @@ msgstr "Wúxiào de nèicún fǎngwèn." msgid "Invalid multicast MAC address" msgstr "wú xiào de duō bō MAC dì zhǐ" -#: shared-bindings/busio/UART.c -msgid "Invalid pins" -msgstr "Wúxiào de yǐn jiǎo" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "dà xiǎo wú xiào" @@ -1531,11 +1511,6 @@ msgstr "Wèi zhǐdìng mì yào" msgid "No long integer support" msgstr "Méiyǒu zhǎng zhěngshù zhīchí" -#: shared-module/usb_hid/__init__.c -#, c-format -msgid "No more than %d HID devices allowed" -msgstr "bù yǔn xǔ chāo guò %d HID shè bèi" - #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" msgstr "Méiyǒu wǎngluò yǔ gāi ssid" @@ -2606,10 +2581,6 @@ msgstr "huǎnchōng qū tài xiǎo" msgid "buffer too small for requested bytes" msgstr "huǎn chōng qū tài xiǎo, duì yú qǐng qiú de zì jié" -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "byteorder is not a string" -msgstr "byteorder bùshì zìfú chuàn" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "zì jié chángdù, bùshì xiàngmù dàxiǎo de bèishù" @@ -2651,14 +2622,10 @@ msgstr "bùnéng fēnpèi dào biǎodá shì" msgid "can't cancel self" msgstr "bù néng qǔ xiāo zì wǒ" -#: py/obj.c py/objint.c shared-module/adafruit_pixelbuf/PixelBuf.c +#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "Wúfǎ jiāng %q zhuǎnhuàn wèi %q" -#: py/runtime.c -msgid "can't convert %q to int" -msgstr "wú fǎ jiāng %q zhuǎn huàn wéi nèi zài" - #: py/obj.c #, c-format msgid "can't convert %s to complex" @@ -2846,10 +2813,6 @@ msgstr "yánsè bìxū jiè yú 0x000000 hé 0xffffff zhī jiān" msgid "comparison of int and uint" msgstr "yīn tè hé wū yīn tè de bǐ jiào" -#: py/objcomplex.c -msgid "complex division by zero" -msgstr "fùzá de fēngé wèi 0" - #: py/objfloat.c py/parsenum.c msgid "complex values not supported" msgstr "bù zhīchí fùzá de zhí" @@ -2954,12 +2917,7 @@ msgstr "chǐ cùn bù pǐ pèi" msgid "div/mod not implemented for uint" msgstr "div/ mó zǔ wèi wéi wèi shí xiàn" -#: py/objfloat.c py/objint_mpz.c -msgid "divide by zero" -msgstr "chú yǐ líng" - -#: py/modmath.c py/objint_longlong.c py/runtime.c -#: shared-bindings/math/__init__.c +#: py/runtime.c msgid "division by zero" msgstr "bèi líng chú" @@ -3333,10 +3291,6 @@ msgstr "shūrù xiàngliàng de chángdù bìxū xiāngděng" msgid "inputs are not iterable" msgstr "shū rù bù kě yí dòng" -#: py/parsenum.c -msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" - #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "zhōng jiān wéi cháng dù xiāng děng de 1D kě yì jiāo qì dìng yì" @@ -3475,10 +3429,6 @@ msgstr "běndì '%q' zài zhī lèixíng zhīqián shǐyòng" msgid "local variable referenced before assignment" msgstr "fùzhí qián yǐnyòng de júbù biànliàng" -#: py/objint.c -msgid "long int not supported in this build" -msgstr "cǐ bǎnběn bù zhīchí zhǎng zhěngshù" - #: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "Wài shè bù zhī chí huán huí + jìng yīn mó shì" @@ -4013,10 +3963,6 @@ msgstr "shuìmián chángdù bìxū shìfēi fùshù" msgid "slice step can't be zero" msgstr "qiēpiàn bù cháng bùnéng wéi líng" -#: py/objslice.c -msgid "slice step cannot be zero" -msgstr "qiēpiàn bù bùnéng wéi líng" - #: py/nativeglue.c msgid "slice unsupported" msgstr "qiē piàn bù shòu zhī chí" @@ -4068,10 +4014,6 @@ msgstr "yuán wèi tú (source_bitmap) de zhí de shù mù (value_count) bì xū msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" -#: shared-bindings/random/__init__.c -msgid "step must be non-zero" -msgstr "bùzhòu bìxū shìfēi líng" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "tíngzhǐ wúfǎ cóng kāishǐ zhōng zhǎodào" @@ -4080,10 +4022,6 @@ msgstr "tíngzhǐ wúfǎ cóng kāishǐ zhōng zhǎodào" msgid "stream operation not supported" msgstr "bù zhīchí liú cāozuò" -#: py/objstrunicode.c -msgid "string indices must be integers, not %q" -msgstr "zìfú chuàn suǒyǐn bìxū shì zhěngshù, ér bùshì %q" - #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "zìfú chuàn bù zhīchí; shǐyòng zì jié huò zì jié zǔ" @@ -4116,10 +4054,6 @@ msgstr "JSON yǔfǎ cuòwù" msgid "syntax error in uctypes descriptor" msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() xūyào 9 xùliè" - #: ports/atmel-samd/common-hal/watchdog/WatchDogTimer.c #: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -4401,10 +4335,6 @@ msgstr "xTaskCreate shī bài" msgid "y value out of bounds" msgstr "y zhí chāochū biānjiè" -#: py/objrange.c -msgid "zero step" -msgstr "líng bù" - #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" msgstr "zi bìxū shì ndarray" @@ -4417,6 +4347,61 @@ 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 "%q length must be >= 1" +#~ msgstr "%q cháng dù bìxū >= 1" + +#~ msgid "%q must be a string" +#~ msgstr "%q bìxū shì yí gè zì fú chuàn" + +#~ msgid "%q must be an int" +#~ msgstr "%q bìxū shì zhěng xíng" + +#~ msgid "%q with a report ID of 0 must be of length 1" +#~ msgstr "bào gào ID shì 0 de %q bì xū cháng dù wéi 1" + +#~ msgid "At most %d %q may be specified (not %d)" +#~ msgstr "zuìduō kěyǐ zhǐdìng %d gè %q (érbúshì %d)" + +#~ msgid "Invalid pins" +#~ msgstr "Wúxiào de yǐn jiǎo" + +#, c-format +#~ msgid "No more than %d HID devices allowed" +#~ msgstr "bù yǔn xǔ chāo guò %d HID shè bèi" + +#~ msgid "byteorder is not a string" +#~ msgstr "byteorder bùshì zìfú chuàn" + +#~ msgid "can't convert %q to int" +#~ msgstr "wú fǎ jiāng %q zhuǎn huàn wéi nèi zài" + +#~ msgid "complex division by zero" +#~ msgstr "fùzá de fēngé wèi 0" + +#~ msgid "divide by zero" +#~ msgstr "chú yǐ líng" + +#~ msgid "int() arg 2 must be >= 2 and <= 36" +#~ msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" + +#~ msgid "long int not supported in this build" +#~ msgstr "cǐ bǎnběn bù zhīchí zhǎng zhěngshù" + +#~ msgid "slice step cannot be zero" +#~ msgstr "qiēpiàn bù bùnéng wéi líng" + +#~ msgid "step must be non-zero" +#~ msgstr "bùzhòu bìxū shìfēi líng" + +#~ msgid "string indices must be integers, not %q" +#~ msgstr "zìfú chuàn suǒyǐn bìxū shì zhěngshù, ér bùshì %q" + +#~ msgid "time.struct_time() takes a 9-sequence" +#~ msgstr "time.struct_time() xūyào 9 xùliè" + +#~ msgid "zero step" +#~ msgstr "líng bù" + #~ msgid "invalid traceback" #~ msgstr "wú xiào zhuī sù" From 91b47d435da57cef67a66b8b954ae1dfc45975f5 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 1 Dec 2022 17:43:18 +0100 Subject: [PATCH 219/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 9 +++++++++ locale/cs.po | 9 +++++++++ locale/de_DE.po | 9 +++++++++ locale/el.po | 9 +++++++++ locale/en_GB.po | 9 +++++++++ locale/es.po | 9 +++++++++ locale/fil.po | 9 +++++++++ locale/fr.po | 9 +++++++++ locale/hi.po | 9 +++++++++ locale/it_IT.po | 9 +++++++++ locale/ja.po | 9 +++++++++ locale/ko.po | 9 +++++++++ locale/nl.po | 9 +++++++++ locale/pl.po | 9 +++++++++ locale/pt_BR.po | 9 +++++++++ locale/ru.po | 9 +++++++++ locale/sv.po | 9 +++++++++ locale/tr.po | 9 +++++++++ locale/zh_Latn_pinyin.po | 9 +++++++++ 19 files changed, 171 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 1252722c70..dcab44b0c3 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -2284,6 +2284,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Jumlah item pada RHS tidak cocok (diharapkan %d, didapatkan %d)." @@ -3154,6 +3155,10 @@ msgstr "lapisan (padding) tidak benar" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3529,6 +3534,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index a08a8c14f8..3d192db1b7 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -2273,6 +2273,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3141,6 +3142,10 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3516,6 +3521,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 04a05d4b9a..6e9518ebef 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -2312,6 +2312,7 @@ msgid "Unkown error code %d" msgstr "Unbekannter Fehlercode %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3212,6 +3213,10 @@ msgstr "padding ist inkorrekt" msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3593,6 +3598,10 @@ msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" msgid "negative shift count" msgstr "Negative shift Anzahl" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "keine SD-Karte" diff --git a/locale/el.po b/locale/el.po index 94f2418c97..6a2221bf79 100644 --- a/locale/el.po +++ b/locale/el.po @@ -2282,6 +2282,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3150,6 +3151,10 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3525,6 +3530,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index de0d9a513a..d0ffe3f22b 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -2286,6 +2286,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Unmatched number of items on RHS (expected %d, got %d)." @@ -3160,6 +3161,10 @@ msgstr "incorrect padding" msgid "index is out of bounds" msgstr "index is out of bounds" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3535,6 +3540,10 @@ msgstr "negative power with no float support" msgid "negative shift count" msgstr "negative shift count" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "no SD card" diff --git a/locale/es.po b/locale/es.po index 4c78717f8f..b2a4e3c97b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -2318,6 +2318,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Número incomparable de elementos en RHS (%d esperado,%d obtenido)." @@ -3200,6 +3201,10 @@ msgstr "relleno (padding) incorrecto" msgid "index is out of bounds" msgstr "el índice está fuera de límites" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3579,6 +3584,10 @@ msgstr "potencia negativa sin float support" msgid "negative shift count" msgstr "cuenta de corrimientos negativo" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "no hay tarjeta SD" diff --git a/locale/fil.po b/locale/fil.po index e74d2c1da3..e0d2c8b145 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -2273,6 +2273,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3154,6 +3155,10 @@ msgstr "mali ang padding" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3533,6 +3538,10 @@ msgstr "negatibong power na walang float support" msgid "negative shift count" msgstr "negative shift count" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index edfab31a58..407d64c643 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -2343,6 +2343,7 @@ msgid "Unkown error code %d" msgstr "Erreur inconnue %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3240,6 +3241,10 @@ msgstr "espacement incorrect" msgid "index is out of bounds" msgstr "l'index est hors limites" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3622,6 +3627,10 @@ msgstr "puissance négative sans support des nombres à virgule flottante" msgid "negative shift count" msgstr "compte de décalage négatif" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "pas de carte SD" diff --git a/locale/hi.po b/locale/hi.po index 7c46dfeadd..d932a0d1f5 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -2255,6 +2255,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3123,6 +3124,10 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3498,6 +3503,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 93b911fc93..487b45c1c8 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -2283,6 +2283,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3162,6 +3163,10 @@ msgstr "padding incorretto" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3542,6 +3547,10 @@ msgstr "potenza negativa senza supporto per float" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 637482c9f1..b70c967cd9 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -2269,6 +2269,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "右辺の要素数が一致しません (expected %d, got %d)" @@ -3141,6 +3142,10 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3517,6 +3522,10 @@ msgstr "" msgid "negative shift count" msgstr "シフトカウントが負数" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "SDカードがありません" diff --git a/locale/ko.po b/locale/ko.po index be6a478270..684e1ebda7 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -2259,6 +2259,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3127,6 +3128,10 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3502,6 +3507,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index bade0bb402..6aaa68cd6d 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -2279,6 +2279,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Niet overeenkomend aantal RHS items (verwachtte %d, kreeg %d)." @@ -3157,6 +3158,10 @@ msgstr "vulling (padding) is onjuist" msgid "index is out of bounds" msgstr "index is buiten bereik" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3535,6 +3540,10 @@ msgstr "negatieve macht terwijl er geen ondersteuning is voor float" msgid "negative shift count" msgstr "negatieve verschuivingstelling (shift count)" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "geen SD kaart" diff --git a/locale/pl.po b/locale/pl.po index 76227fef54..f33e2b4e78 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -2266,6 +2266,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Zła liczba obiektów po prawej stronie (oczekiwano %d, jest %d)." @@ -3135,6 +3136,10 @@ msgstr "złe wypełnienie" msgid "index is out of bounds" msgstr "indeks jest poza zakresem" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3510,6 +3515,10 @@ msgstr "ujemna potęga, ale brak obsługi liczb zmiennoprzecinkowych" msgid "negative shift count" msgstr "ujemne przesunięcie" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e768c6310e..894a70e105 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -2325,6 +2325,7 @@ msgid "Unkown error code %d" msgstr "Código de erro desconhecido %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Quantidade inigualável de itens no RHS (%d esperado, obteve %d)." @@ -3217,6 +3218,10 @@ msgstr "preenchimento incorreto" msgid "index is out of bounds" msgstr "o índice está fora dos limites" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3598,6 +3603,10 @@ msgstr "potência negativa sem suporte de flutuação" msgid "negative shift count" msgstr "contagem de turnos negativos" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "nenhum cartão SD" diff --git a/locale/ru.po b/locale/ru.po index 4e16f66535..8b873461cf 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -2323,6 +2323,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3191,6 +3192,10 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3566,6 +3571,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index edb16acdd8..7e09265ee9 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -2301,6 +2301,7 @@ msgid "Unkown error code %d" msgstr "Okänd felkod %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Omatchat antal på RHS (förväntat %d, fick %d)." @@ -3186,6 +3187,10 @@ msgstr "felaktig utfyllnad" msgid "index is out of bounds" msgstr "index är utanför gränserna" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3564,6 +3569,10 @@ msgstr "negativ exponent utan stöd för flyttal" msgid "negative shift count" msgstr "negativt skiftantal" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "inget SD-kort" diff --git a/locale/tr.po b/locale/tr.po index 3d78a8c0f9..20519bc2b6 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -2275,6 +2275,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3143,6 +3144,10 @@ msgstr "" msgid "index is out of bounds" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3518,6 +3523,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 04ad1b28aa..86c5ef2776 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -2306,6 +2306,7 @@ msgid "Unkown error code %d" msgstr "wèi zhī cuò wù dài %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "RHS (yùqí %d, huòdé %d) shàng wèi pǐpèi de xiàngmù." @@ -3192,6 +3193,10 @@ msgstr "bù zhèngquè de tiánchōng" msgid "index is out of bounds" msgstr "suǒyǐn chāochū fànwéi" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "index must be tuple or int" +msgstr "" + #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c #: shared-bindings/bitmaptools/__init__.c @@ -3568,6 +3573,10 @@ msgstr "méiyǒu fú diǎn zhīchí de xiāojí gōnglǜ" msgid "negative shift count" msgstr "fù zhuǎnyí jìshù" +#: shared-bindings/adafruit_pixelbuf/PixelMap.c +msgid "nested index must be int" +msgstr "" + #: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "méiyǒu SD kǎ" From 42f1d50acc37de1cbe5834bd27b7a45f42955aef Mon Sep 17 00:00:00 2001 From: foamyguy Date: Thu, 1 Dec 2022 17:25:36 -0600 Subject: [PATCH 220/357] remove extra function call. handle show(None) for framebuffer and epaper --- shared-module/displayio/Display.c | 2 +- shared-module/displayio/EPaperDisplay.c | 3 +++ shared-module/framebufferio/FramebufferDisplay.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 1f7891dc17..8367e23b59 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -142,7 +142,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group) { if (root_group == NULL) { - return displayio_display_core_set_root_group(&self->core, &circuitpython_splash); + root_group = &circuitpython_splash; } return displayio_display_core_set_root_group(&self->core, root_group); } diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 68464d50ea..09bd5d6897 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -103,6 +103,9 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t } bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group) { + if (root_group == NULL) { + root_group = &circuitpython_splash; + } return displayio_display_core_set_root_group(&self->core, root_group); } diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 7575523166..70a0e6639d 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -102,6 +102,9 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu } bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t *self, displayio_group_t *root_group) { + if (root_group == NULL) { + root_group = &circuitpython_splash; + } return displayio_display_core_set_root_group(&self->core, root_group); } From 57462092b5be52dc13b9b02a79bdd58f1aaac9a3 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Thu, 1 Dec 2022 17:34:43 -0600 Subject: [PATCH 221/357] return None instead of NULL for framebuffer and epaper --- shared-module/displayio/EPaperDisplay.c | 3 +++ shared-module/framebufferio/FramebufferDisplay.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 09bd5d6897..d876599650 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -247,6 +247,9 @@ uint16_t common_hal_displayio_epaperdisplay_get_rotation(displayio_epaperdisplay } mp_obj_t common_hal_displayio_epaperdisplay_get_root_group(displayio_epaperdisplay_obj_t *self) { + if (self->core.current_group == NULL) { + return mp_const_none; + } return self->core.current_group; } diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 70a0e6639d..3d66370c04 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -363,6 +363,9 @@ void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj } mp_obj_t common_hal_framebufferio_framebufferdisplay_get_root_group(framebufferio_framebufferdisplay_obj_t *self) { + if (self->core.current_group == NULL) { + return mp_const_none; + } return self->core.current_group; } From 7583ccad2a4f86548467576a1cd3247c0ce4b573 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 1 Dec 2022 19:27:49 -0600 Subject: [PATCH 222/357] Ensure orderly shutdown of ssl socket A crash would occur if an SSL socket was not shut down before `gc_deinit()`. I do not fully understand the root cause, but some object deinitialization / deallocation prior to `gc_deinit` leaves the SSL object in an inconsistent state. Rather than resolve the root cause, instead ensure that the closing of the user socket also closes the SSL socket. Closes: #6502 --- .../espressif/common-hal/socketpool/Socket.c | 25 +++++++++++++------ .../espressif/common-hal/socketpool/Socket.h | 1 + ports/espressif/common-hal/ssl/SSLContext.c | 1 + ports/espressif/common-hal/ssl/SSLSocket.h | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index 5f34d674b2..edaed97598 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -31,6 +31,8 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "shared-bindings/socketpool/SocketPool.h" +#include "shared-bindings/ssl/SSLSocket.h" +#include "common-hal/ssl/SSLSocket.h" #include "supervisor/port.h" #include "supervisor/shared/tick.h" #include "supervisor/workflow.h" @@ -44,7 +46,7 @@ StackType_t socket_select_stack[2 * configMINIMAL_STACK_SIZE]; STATIC int open_socket_fds[CONFIG_LWIP_MAX_SOCKETS]; -STATIC bool user_socket[CONFIG_LWIP_MAX_SOCKETS]; +STATIC socketpool_socket_obj_t *user_socket[CONFIG_LWIP_MAX_SOCKETS]; StaticTask_t socket_select_task_handle; STATIC int socket_change_fd = -1; @@ -117,7 +119,7 @@ void socket_user_reset(void) { for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { open_socket_fds[i] = -1; - user_socket[i] = false; + user_socket[i] = NULL; } socket_change_fd = eventfd(0, 0); // Run this at the same priority as CP so that the web workflow background task can be @@ -134,12 +136,13 @@ void socket_user_reset(void) { for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { if (open_socket_fds[i] >= 0 && user_socket[i]) { + common_hal_socketpool_socket_close(user_socket[i]); int num = open_socket_fds[i]; // Close automatically clears socket handle lwip_shutdown(num, SHUT_RDWR); lwip_close(num); open_socket_fds[i] = -1; - user_socket[i] = false; + user_socket[i] = NULL; } } } @@ -171,10 +174,10 @@ STATIC void unregister_open_socket(int fd) { } } -STATIC void mark_user_socket(int fd) { +STATIC void mark_user_socket(int fd, socketpool_socket_obj_t *obj) { for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { if (open_socket_fds[i] == fd) { - user_socket[i] = true; + user_socket[i] = obj; return; } } @@ -236,7 +239,7 @@ socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_ if (!socketpool_socket(self, family, type, sock)) { mp_raise_RuntimeError(translate("Out of sockets")); } - mark_user_socket(sock->num); + mark_user_socket(sock->num, sock); return sock; } @@ -292,12 +295,12 @@ int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port) { + socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); int newsoc = socketpool_socket_accept(self, ip, port, NULL); if (newsoc > 0) { - mark_user_socket(newsoc); // Create the socket - socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); + mark_user_socket(newsoc, sock); sock->base.type = &socketpool_socket_type; sock->num = newsoc; sock->pool = self->pool; @@ -338,6 +341,12 @@ bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t *self, } void socketpool_socket_close(socketpool_socket_obj_t *self) { + if (self->ssl_socket) { + ssl_sslsocket_obj_t *ssl_socket = self->ssl_socket; + self->ssl_socket = NULL; + common_hal_ssl_sslsocket_close(ssl_socket); + return; + } self->connected = false; if (self->num >= 0) { lwip_shutdown(self->num, SHUT_RDWR); diff --git a/ports/espressif/common-hal/socketpool/Socket.h b/ports/espressif/common-hal/socketpool/Socket.h index b91419807c..b189889cfd 100644 --- a/ports/espressif/common-hal/socketpool/Socket.h +++ b/ports/espressif/common-hal/socketpool/Socket.h @@ -42,6 +42,7 @@ typedef struct { int ipproto; bool connected; socketpool_socketpool_obj_t *pool; + struct ssl_sslsocket_obj *ssl_socket; mp_uint_t timeout_ms; } socketpool_socket_obj_t; diff --git a/ports/espressif/common-hal/ssl/SSLContext.c b/ports/espressif/common-hal/ssl/SSLContext.c index 386986e6be..1923a9c2a9 100644 --- a/ports/espressif/common-hal/ssl/SSLContext.c +++ b/ports/espressif/common-hal/ssl/SSLContext.c @@ -48,6 +48,7 @@ ssl_sslsocket_obj_t *common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t sock->base.type = &ssl_sslsocket_type; sock->ssl_context = self; sock->sock = socket; + socket->ssl_socket = sock; // Create a copy of the ESP-TLS config object and store the server hostname // Note that ESP-TLS will use common_name for both SNI and verification diff --git a/ports/espressif/common-hal/ssl/SSLSocket.h b/ports/espressif/common-hal/ssl/SSLSocket.h index 097f19857b..6b65a56223 100644 --- a/ports/espressif/common-hal/ssl/SSLSocket.h +++ b/ports/espressif/common-hal/ssl/SSLSocket.h @@ -34,7 +34,7 @@ #include "components/esp-tls/esp_tls.h" -typedef struct { +typedef struct ssl_sslsocket_obj { mp_obj_base_t base; socketpool_socket_obj_t *sock; esp_tls_t *tls; From 255e9973450acb8769038307f09a1aff23eb2b23 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 1 Dec 2022 17:39:49 -0800 Subject: [PATCH 223/357] Rework the analogbufio API. * read() is now readinto() and takes the buffer to write into. * readinto() returns the number of valid samples. * readinto() can be interrupted by ctrl-c. * readinto() API doesn't support signed numbers because it never did. * sample_rate is now required in the constructor because supported values will vary per-port. * 16 bit values are full range. 12 bit samples from RP2040 are stretched in the same way they are for AnalogIn. Fixes #7226 --- locale/circuitpython.pot | 3 + .../common-hal/analogbufio/BufferedIn.c | 106 +++++++++++------- .../common-hal/analogbufio/BufferedIn.h | 7 -- shared-bindings/analogbufio/BufferedIn.c | 89 +++++++-------- shared-bindings/analogbufio/BufferedIn.h | 4 +- shared-bindings/analogbufio/__init__.c | 16 --- 6 files changed, 108 insertions(+), 117 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3958d2869a..d8e6d69c2f 100755 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -159,6 +159,9 @@ msgid "%q must be >= %d" msgstr "" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c index 951c07af03..1b0a0d684a 100644 --- a/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c +++ b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c @@ -33,6 +33,7 @@ #include "common-hal/analogbufio/BufferedIn.h" #include "shared-bindings/analogbufio/BufferedIn.h" #include "shared-bindings/microcontroller/Pin.h" +#include "shared/runtime/interrupt_char.h" #include "py/runtime.h" #include "supervisor/shared/translate/translate.h" #include "src/rp2_common/hardware_adc/include/hardware/adc.h" @@ -42,13 +43,18 @@ #define ADC_FIRST_PIN_NUMBER 26 #define ADC_PIN_COUNT 4 -void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *self, const mcu_pin_obj_t *pin, uint8_t *buffer, uint32_t len, uint8_t bytes_per_sample, bool samples_signed, uint32_t sample_rate) { +#define ADC_CLOCK_INPUT 48000000 +#define ADC_MAX_CLOCK_DIV (1 << (ADC_DIV_INT_MSB - ADC_DIV_INT_LSB + 1)) +void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *self, const mcu_pin_obj_t *pin, uint32_t sample_rate) { // Make sure pin number is in range for ADC if (pin->number < ADC_FIRST_PIN_NUMBER || pin->number >= (ADC_FIRST_PIN_NUMBER + ADC_PIN_COUNT)) { raise_ValueError_invalid_pins(); } + // Validate sample rate here + sample_rate = (uint32_t)mp_arg_validate_int_range(sample_rate, ADC_CLOCK_INPUT / ADC_MAX_CLOCK_DIV, ADC_CLOCK_INPUT / 96, MP_QSTR_sample_rate); + // Set pin and channel self->pin = pin; claim_pin(pin); @@ -56,45 +62,13 @@ void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *s // TODO: find a way to accept ADC4 for temperature self->chan = pin->number - ADC_FIRST_PIN_NUMBER; - // Set buffer and length - self->buffer = buffer; - self->len = len; - - // Set sample rate - used in read - self->bytes_per_sample = bytes_per_sample; - self->sample_rate = sample_rate; - // Init GPIO for analogue use: hi-Z, no pulls, disable digital input buffer. + // TODO: Make sure we share the ADC well. Right now we just assume it is + // unused. adc_init(); adc_gpio_init(pin->number); adc_select_input(self->chan); // chan = pin - 26 ?? - // RP2040 Implementation Detail - // Fills the supplied buffer with ADC values using DMA transfer. - // If the buffer is 8-bit, then values are 8-bit shifted and error bit is off. - // If buffer is 16-bit, then values are not shifted and error bit is present. - // Number of transfers is always the number of samples which is the array - // byte length divided by the bytes_per_sample. - - // self->bytes_per_sample == 1 - uint dma_size = DMA_SIZE_8; - bool show_error_bit = false; - bool shift_sample_8_bits = true; - if (self->bytes_per_sample == 2) { - dma_size = DMA_SIZE_16; - show_error_bit = true; - shift_sample_8_bits = false; - } - - // adc_select_input(self->pin->number - ADC_FIRST_PIN_NUMBER); - adc_fifo_setup( - true, // Write each completed conversion to the sample FIFO - true, // Enable DMA data request (DREQ) - 1, // DREQ (and IRQ) asserted when at least 1 sample present - show_error_bit, // See the ERR bit - shift_sample_8_bits // Shift each sample to 8 bits when pushing to FIFO - ); - // Divisor of 0 -> full speed. Free-running capture with the divider is // equivalent to pressing the ADC_CS_START_ONCE button once per `div + 1` // cycles (div not necessarily an integer). Each conversion takes 96 @@ -104,7 +78,9 @@ void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *s // sample rate determines divisor, not zero. // sample_rate is forced to be >= 1 in shared-bindings - adc_set_clkdiv((float)48000000.0 / (float)self->sample_rate); + float clk_div = (float)ADC_CLOCK_INPUT / (float)sample_rate; + mp_printf(&mp_plat_print, "clk_div %f for %d\n", (double)clk_div, sample_rate); + adc_set_clkdiv(clk_div); // Set up the DMA to start transferring data as soon as it appears in FIFO uint dma_chan = dma_claim_unused_channel(true); @@ -114,7 +90,6 @@ void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *s self->cfg = dma_channel_get_default_config(dma_chan); // Reading from constant address, writing to incrementing byte addresses - channel_config_set_transfer_data_size(&(self->cfg), dma_size); channel_config_set_read_increment(&(self->cfg), false); channel_config_set_write_increment(&(self->cfg), true); @@ -143,14 +118,36 @@ void common_hal_analogbufio_bufferedin_deinit(analogbufio_bufferedin_obj_t *self dma_channel_unclaim(self->dma_chan); } -void common_hal_analogbufio_bufferedin_read(analogbufio_bufferedin_obj_t *self) { +uint32_t common_hal_analogbufio_bufferedin_readinto(analogbufio_bufferedin_obj_t *self, uint8_t *buffer, uint32_t len, uint8_t bytes_per_sample) { + // RP2040 Implementation Detail + // Fills the supplied buffer with ADC values using DMA transfer. + // If the buffer is 8-bit, then values are 8-bit shifted and error bit is off. + // If buffer is 16-bit, then values are not shifted and error bit is present. + // Number of transfers is always the number of samples which is the array + // byte length divided by the bytes_per_sample. + uint dma_size = DMA_SIZE_8; + bool show_error_bit = false; + if (bytes_per_sample == 2) { + dma_size = DMA_SIZE_16; + show_error_bit = true; + } - uint32_t cdl = self->len / self->bytes_per_sample; + adc_fifo_setup( + true, // Write each completed conversion to the sample FIFO + true, // Enable DMA data request (DREQ) + 1, // DREQ (and IRQ) asserted when at least 1 sample present + show_error_bit, // See the ERR bit + bytes_per_sample == 1 // Shift each sample to 8 bits when pushing to FIFO + ); + + uint32_t sample_count = len / bytes_per_sample; + + channel_config_set_transfer_data_size(&(self->cfg), dma_size); dma_channel_configure(self->dma_chan, &(self->cfg), - self->buffer, // dst + buffer, // dst &adc_hw->fifo, // src - cdl, // transfer count + sample_count, // transfer count true // start immediately ); @@ -159,9 +156,34 @@ void common_hal_analogbufio_bufferedin_read(analogbufio_bufferedin_obj_t *self) // Once DMA finishes, stop any new conversions from starting, and clean up // the FIFO in case the ADC was still mid-conversion. - dma_channel_wait_for_finish_blocking(self->dma_chan); + uint32_t remaining_transfers = sample_count; + while (dma_channel_is_busy(self->dma_chan) && + !mp_hal_is_interrupted()) { + RUN_BACKGROUND_TASKS; + } + remaining_transfers = dma_channel_hw_addr(self->dma_chan)->transfer_count; // Clean up adc_run(false); + // Stopping early so abort. + if (dma_channel_is_busy(self->dma_chan)) { + dma_channel_abort(self->dma_chan); + } adc_fifo_drain(); + + size_t captured_count = sample_count - remaining_transfers; + if (dma_size == DMA_SIZE_16) { + uint16_t *buf16 = (uint16_t *)buffer; + for (size_t i = 0; i < captured_count; i++) { + uint16_t value = buf16[i]; + // Check the error bit and "truncate" the buffer if there is an error. + if ((value & ADC_FIFO_ERR_BITS) != 0) { + captured_count = i; + break; + } + // Scale the values to the standard 16 bit range. + buf16[i] = (value << 4) | (value >> 8); + } + } + return captured_count; } diff --git a/ports/raspberrypi/common-hal/analogbufio/BufferedIn.h b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.h index 8b183a1d70..8ed4cf3a2c 100644 --- a/ports/raspberrypi/common-hal/analogbufio/BufferedIn.h +++ b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.h @@ -41,16 +41,9 @@ typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; - uint8_t *buffer; - uint32_t len; - uint8_t bytes_per_sample; - bool samples_signed; - uint32_t sample_rate; uint8_t chan; uint dma_chan; dma_channel_config cfg; } analogbufio_bufferedin_obj_t; -void bufferedin_init(void); - #endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ANALOGBUFIO_BUFFEREDIN_H diff --git a/shared-bindings/analogbufio/BufferedIn.c b/shared-bindings/analogbufio/BufferedIn.c index 8bdc1b0ea8..d6c6b4a46e 100644 --- a/shared-bindings/analogbufio/BufferedIn.c +++ b/shared-bindings/analogbufio/BufferedIn.c @@ -49,8 +49,8 @@ //| length = 1000 //| mybuffer = array.array("H", 0x0000 for i in range(length)) //| rate = 500000 -//| adcbuf = analogbufio.BufferedIn(board.GP26, mybuffer, rate) -//| adcbuf.read() +//| adcbuf = analogbufio.BufferedIn(board.GP26, sample_rate=rate) +//| adcbuf.readinto(mybuffer) //| adcbuf.deinit() //| for i in range(length): //| print(i, mybuffer[i]) @@ -60,26 +60,17 @@ //| (TODO) Provide mechanism to read CPU Temperature.""" //| -//| def __init__( -//| self, pin: microcontroller.Pin, buffer: WriteableBuffer, *, sample_rate: int = 500000 -//| ) -> None: -//| """Create a `BufferedIn` on the given pin. ADC values will be read -//| into the given buffer at the supplied sample_rate. Depending on the -//| buffer typecode, 'b', 'B', 'h', 'H', samples are 8-bit byte-arrays or -//| 16-bit half-words and are signed or unsigned. -//| The ADC most significant bits of the ADC are kept. (See -//| https://docs.circuitpython.org/en/latest/docs/library/array.html) +//| def __init__(self, pin: microcontroller.Pin, *, sample_rate: int) -> None: +//| """Create a `BufferedIn` on the given pin and given sample rate. //| //| :param ~microcontroller.Pin pin: the pin to read from -//| :param ~circuitpython_typing.WriteableBuffer buffer: buffer: A buffer for samples //| :param ~int sample_rate: rate: sampling frequency, in samples per second""" //| ... STATIC mp_obj_t analogbufio_bufferedin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_pin, ARG_buffer, ARG_sample_rate }; + enum { ARG_pin, ARG_sample_rate }; static const mp_arg_t allowed_args[] = { { MP_QSTR_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_buffer, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_sample_rate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 500000} }, + { MP_QSTR_sample_rate, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_INT }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -87,37 +78,12 @@ STATIC mp_obj_t analogbufio_bufferedin_make_new(const mp_obj_type_t *type, size_ // Validate Pin const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); - // Buffer defined and allocated by user - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_READ); - - // signed or unsigned, byte per sample - bool signed_samples = bufinfo.typecode == 'b' || bufinfo.typecode == 'h'; - uint8_t bytes_per_sample = 1; - - // Bytes Per Sample - if (bufinfo.typecode == 'h' || bufinfo.typecode == 'H') { - bytes_per_sample = 2; - } else if (bufinfo.typecode != 'b' && bufinfo.typecode != 'B' && bufinfo.typecode != BYTEARRAY_TYPECODE) { - mp_raise_ValueError_varg(translate("%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"), MP_QSTR_buffer); - } - - // Validate sample rate here - uint32_t sample_rate = (uint32_t)mp_arg_validate_int_range(args[ARG_sample_rate].u_int, 1, 500000, MP_QSTR_sample_rate); - // Create local object - analogbufio_bufferedin_obj_t *self = m_new_obj(analogbufio_bufferedin_obj_t); + analogbufio_bufferedin_obj_t *self = m_new_obj_with_finaliser(analogbufio_bufferedin_obj_t); self->base.type = &analogbufio_bufferedin_type; - // Call local intereface in ports/common-hal/analogbufio - common_hal_analogbufio_bufferedin_construct(self, - pin, - ((uint8_t *)bufinfo.buf), - bufinfo.len, - bytes_per_sample, - signed_samples, - sample_rate - ); + // Call local interface in ports/common-hal/analogbufio + common_hal_analogbufio_bufferedin_construct(self, pin, args[ARG_sample_rate].u_int); return MP_OBJ_FROM_PTR(self); } @@ -153,23 +119,46 @@ STATIC mp_obj_t analogbufio_bufferedin___exit__(size_t n_args, const mp_obj_t *a } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogbufio_bufferedin___exit___obj, 4, 4, analogbufio_bufferedin___exit__); -//| def read(self) -> None: -//| """Fills the provided buffer with ADC voltage values.""" +//| def readinto(self, buffer: WriteableBuffer) -> int: +//| """Fills the provided buffer with ADC voltage values. +//| +//| ADC values will be read into the given buffer at the supplied sample_rate. +//| Depending on the buffer typecode, 'B', 'H', samples are 8-bit byte-arrays or +//| 16-bit half-words and are always unsigned. +//| The ADC most significant bits of the ADC are kept. (See +//| https://docs.circuitpython.org/en/latest/docs/library/array.html) +//| +//| :param ~circuitpython_typing.WriteableBuffer buffer: buffer: A buffer for samples""" //| ... //| -STATIC mp_obj_t analogbufio_bufferedin_obj_read(mp_obj_t self_in) { +STATIC mp_obj_t analogbufio_bufferedin_obj_readinto(mp_obj_t self_in, mp_obj_t buffer_obj) { analogbufio_bufferedin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - common_hal_analogbufio_bufferedin_read(self); - return mp_const_none; + + // Buffer defined and allocated by user + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buffer_obj, &bufinfo, MP_BUFFER_READ); + + uint8_t bytes_per_sample = 1; + + // Bytes Per Sample + if (bufinfo.typecode == 'H') { + bytes_per_sample = 2; + } else if (bufinfo.typecode != 'B' && bufinfo.typecode != BYTEARRAY_TYPECODE) { + mp_raise_ValueError_varg(translate("%q must be a bytearray or array of type 'H' or 'B'"), MP_QSTR_buffer); + } + + mp_uint_t captured = common_hal_analogbufio_bufferedin_readinto(self, bufinfo.buf, bufinfo.len, bytes_per_sample); + return MP_OBJ_NEW_SMALL_INT(captured); } -MP_DEFINE_CONST_FUN_OBJ_1(analogbufio_bufferedin_read_obj, analogbufio_bufferedin_obj_read); +MP_DEFINE_CONST_FUN_OBJ_2(analogbufio_bufferedin_readinto_obj, analogbufio_bufferedin_obj_readinto); STATIC const mp_rom_map_elem_t analogbufio_bufferedin_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&analogbufio_bufferedin_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&analogbufio_bufferedin_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&analogbufio_bufferedin___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&analogbufio_bufferedin_read_obj)}, + { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&analogbufio_bufferedin_readinto_obj)}, }; diff --git a/shared-bindings/analogbufio/BufferedIn.h b/shared-bindings/analogbufio/BufferedIn.h index 7d59720cb4..cfd8050bc5 100644 --- a/shared-bindings/analogbufio/BufferedIn.h +++ b/shared-bindings/analogbufio/BufferedIn.h @@ -32,9 +32,9 @@ extern const mp_obj_type_t analogbufio_bufferedin_type; -void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *self, const mcu_pin_obj_t *pin, uint8_t *buffer, uint32_t len, uint8_t bytes_per_sample, bool samples_signed, uint32_t sample_rate); +void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *self, const mcu_pin_obj_t *pin, uint32_t sample_rate); void common_hal_analogbufio_bufferedin_deinit(analogbufio_bufferedin_obj_t *self); bool common_hal_analogbufio_bufferedin_deinited(analogbufio_bufferedin_obj_t *self); -void common_hal_analogbufio_bufferedin_read(analogbufio_bufferedin_obj_t *self); +uint32_t common_hal_analogbufio_bufferedin_readinto(analogbufio_bufferedin_obj_t *self, uint8_t *buffer, uint32_t len, uint8_t bytes_per_sample); #endif // __MICROPY_INCLUDED_SHARED_BINDINGS_ANALOGBUFIO_BUFFEREDIN_H__ diff --git a/shared-bindings/analogbufio/__init__.c b/shared-bindings/analogbufio/__init__.c index 49463d6334..749f1aec09 100644 --- a/shared-bindings/analogbufio/__init__.c +++ b/shared-bindings/analogbufio/__init__.c @@ -40,22 +40,6 @@ //| call :py:meth:`!deinit` or use a context manager. See //| :ref:`lifetime-and-contextmanagers` for more info. //| -//| For example:: -//| -//| import analogbufio -//| import array -//| from board import * -//| -//| length = 5000000 -//| mybuffer = array.array("H", 0x0000 for i in range(length)) -//| adc_in = analogbufio.BufferedIn(GP26, mybuffer, length) -//| analogbufio.read() -//| print(*mybuffer) -//| adc_in.deinit() -//| -//| This example will initialize the the device, read and fill -//| :py:data:`~analogbufio.BufferedIn` to mybuffer -//| //| TODO: For the essentials of `analogbufio`, see the `CircuitPython Essentials //| Learn guide `_ //| From 7ceca0cbb2c36e275131b80fde3ff1922eddc62e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 1 Dec 2022 19:41:28 -0600 Subject: [PATCH 224/357] fix display of the 'host not found' message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The conversion of characters like _space_ in qstrs is a bit ad-hoc. Because "_not_" stands for the logical negation character ¬ the recently added message was displayed incorrectly: ``` >>> socket.getaddrinfo('does.not.exist', 0) Traceback (most recent call last): File "", line 1, in gaierror: (-2, 'Name or service_space¬space_known') ``` I had noticed this, but evidently failed to include the fix in the problem in #7269. --- py/makeqstrdefs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/py/makeqstrdefs.py b/py/makeqstrdefs.py index f035ed5745..974227f2a5 100644 --- a/py/makeqstrdefs.py +++ b/py/makeqstrdefs.py @@ -65,6 +65,7 @@ name2codepoint["tilde"] = ord("~") # These are just vexing! del name2codepoint["and"] del name2codepoint["or"] +del name2codepoint["not"] def preprocess(): From ded0ee4816b6aee4fd3a9f1a624e93c91b534f62 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 1 Dec 2022 17:54:41 -0800 Subject: [PATCH 225/357] Fix MDNS hostname mangling cpy-MAC hostnames were being mangled on circuitpython.local conflicts. Fixes #6869 --- .gitmodules | 2 +- ports/espressif/esp-idf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index ae413799c7..3c0128f77d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -146,7 +146,7 @@ [submodule "ports/espressif/esp-idf"] path = ports/espressif/esp-idf url = https://github.com/adafruit/esp-idf.git - branch = circuitpython8 + branch = release/v4.4-circuitpython [submodule "ports/espressif/certificates/nina-fw"] path = lib/certificates/nina-fw url = https://github.com/adafruit/nina-fw.git diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index 26716e006d..20c6d4a623 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit 26716e006d68e5a584ac29b85d9e2979563fc827 +Subproject commit 20c6d4a623a9391afd0e803b2bbebe020ed15ec8 From 42e7981b4f961b5829285463ec56f48f0093bb0a Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 1 Dec 2022 18:23:01 +0000 Subject: [PATCH 226/357] Translated using Weblate (Swedish) Currently translated at 100.0% (982 of 982 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 7e09265ee9..d95ca33b5f 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-11-30 20:18+0000\n" +"PO-Revision-Date: 2022-12-02 01:55+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -201,7 +201,7 @@ msgstr "Pinne %q ogiltig" #: py/objrange.c py/objslice.c shared-bindings/random/__init__.c msgid "%q step cannot be zero" -msgstr "" +msgstr "%q steg kan inte vara noll" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -3189,7 +3189,7 @@ msgstr "index är utanför gränserna" #: shared-bindings/adafruit_pixelbuf/PixelMap.c msgid "index must be tuple or int" -msgstr "" +msgstr "index måste vara tuple eller int" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c @@ -3571,7 +3571,7 @@ msgstr "negativt skiftantal" #: shared-bindings/adafruit_pixelbuf/PixelMap.c msgid "nested index must be int" -msgstr "" +msgstr "nästlat index måste vara en int" #: shared-module/sdcardio/SDCard.c msgid "no SD card" From 6a34f51465c5e71b0e30f6abe9a80119d5d7de42 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 2 Dec 2022 02:55:28 +0100 Subject: [PATCH 227/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 16 ++++++++++++++++ locale/cs.po | 16 ++++++++++++++++ locale/de_DE.po | 16 ++++++++++++++++ locale/el.po | 16 ++++++++++++++++ locale/en_GB.po | 16 ++++++++++++++++ locale/es.po | 16 ++++++++++++++++ locale/fil.po | 16 ++++++++++++++++ locale/fr.po | 16 ++++++++++++++++ locale/hi.po | 16 ++++++++++++++++ locale/it_IT.po | 16 ++++++++++++++++ locale/ja.po | 16 ++++++++++++++++ locale/ko.po | 16 ++++++++++++++++ locale/nl.po | 16 ++++++++++++++++ locale/pl.po | 16 ++++++++++++++++ locale/pt_BR.po | 16 ++++++++++++++++ locale/ru.po | 16 ++++++++++++++++ locale/sv.po | 16 ++++++++++++++++ locale/tr.po | 16 ++++++++++++++++ locale/zh_Latn_pinyin.po | 16 ++++++++++++++++ 19 files changed, 304 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index dcab44b0c3..3b169152f5 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1979,6 +1979,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Berikan setidaknya satu pin UART" @@ -2371,6 +2375,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 3d192db1b7..e7906f40a0 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1968,6 +1968,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -2358,6 +2362,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 6e9518ebef..5310fda215 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1993,6 +1993,10 @@ msgstr "Stereo links muss sich auf PWM-Kanal A befinden" msgid "Stereo right must be on PWM channel B" msgstr "Stereo rechts muss sich auf PWM-Kanal B befinden" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Gib mindestens einen UART-Pin an" @@ -2411,6 +2415,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "Wi-Fi: " +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Aufgeweckt durch Alarm.\n" diff --git a/locale/el.po b/locale/el.po index 6a2221bf79..85a0bb31ff 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1977,6 +1977,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -2367,6 +2371,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index d0ffe3f22b..a349cfa422 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -1974,6 +1974,10 @@ msgstr "Stereo left must be on PWM channel A" msgid "Stereo right must be on PWM channel B" msgstr "Stereo right must be on PWM channel B" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Supply at least one UART pin" @@ -2373,6 +2377,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Woken up by alarm.\n" diff --git a/locale/es.po b/locale/es.po index b2a4e3c97b..5016035bc1 100644 --- a/locale/es.po +++ b/locale/es.po @@ -2003,6 +2003,10 @@ msgstr "Estéreo izquierdo debe estar en el canal PWM A" msgid "Stereo right must be on PWM channel B" msgstr "Estéreo derecho debe estar en el canal PWM B" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Suministre al menos un pin UART" @@ -2408,6 +2412,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Despertado por la alarma.\n" diff --git a/locale/fil.po b/locale/fil.po index e0d2c8b145..246a7e2c81 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1967,6 +1967,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -2359,6 +2363,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 407d64c643..b964b6e301 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -2023,6 +2023,10 @@ msgstr "Canal stéréo gauche doit être sur le canal PWM A" msgid "Stereo right must be on PWM channel B" msgstr "Canal stéréo droit doit être sur le canal PWM B" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Fournissez au moins une broche UART" @@ -2440,6 +2444,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "Wi-Fi : " +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Réveil par alarme.\n" diff --git a/locale/hi.po b/locale/hi.po index d932a0d1f5..c4b1d62139 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1950,6 +1950,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -2340,6 +2344,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 487b45c1c8..784d7723a8 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1977,6 +1977,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -2369,6 +2373,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index b70c967cd9..47caa45a91 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1963,6 +1963,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "少なくとも1つのUARTピンが必要" @@ -2354,6 +2358,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 684e1ebda7..7106244843 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1953,6 +1953,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -2344,6 +2348,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 6aaa68cd6d..35fcd7e8cd 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1974,6 +1974,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Geef op zijn minst 1 UART pin op" @@ -2370,6 +2374,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Gewekt door alarm.\n" diff --git a/locale/pl.po b/locale/pl.po index f33e2b4e78..e001f37108 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1961,6 +1961,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Podaj co najmniej jeden pin UART" @@ -2351,6 +2355,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 894a70e105..f89157c53b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -2006,6 +2006,10 @@ msgstr "O estéreo à esquerda deve estar no canal PWM A" msgid "Stereo right must be on PWM channel B" msgstr "O estéreo à direita deve estar no canal PWM B" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Forneça pelo menos um pino UART" @@ -2421,6 +2425,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "Wi-Fi: " +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Foi despertado através do alarme.\n" diff --git a/locale/ru.po b/locale/ru.po index 8b873461cf..6536c624ff 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -2016,6 +2016,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Предоставьте хотяб один пин UART" @@ -2408,6 +2412,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index d95ca33b5f..cb0a0daf8e 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1986,6 +1986,10 @@ msgstr "Vänster stereokanal måste använda PWM kanal A" msgid "Stereo right must be on PWM channel B" msgstr "Höger stereokanal måste använda PWM kanal B" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Ange minst en UART-pinne" @@ -2394,6 +2398,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "Wi-Fi: " +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "Vaknade av larm.\n" diff --git a/locale/tr.po b/locale/tr.po index 20519bc2b6..f2d0e00c1e 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -1970,6 +1970,10 @@ msgstr "" msgid "Stereo right must be on PWM channel B" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -2360,6 +2364,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 86c5ef2776..93542306cb 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1990,6 +1990,10 @@ msgstr "lì tǐ shēng zuǒ bì xū shì zài PWM tōng dào A" msgid "Stereo right must be on PWM channel B" msgstr "lì tǐ shēng yòu cè bì xū zài PWM tōng dào B shàng" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Stopping AP is not supported." +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" @@ -2399,6 +2403,18 @@ msgstr "" msgid "Wi-Fi: " msgstr "Wi-Fi: " +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in access point mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is in station mode." +msgstr "" + +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "Wifi is not enabled" +msgstr "" + #: main.c msgid "Woken up by alarm.\n" msgstr "bèi jǐng bào chǎo xǐng.\n" From b5dda0b7703ba299a7e89a20a94926393000ce48 Mon Sep 17 00:00:00 2001 From: m1cha1s Date: Fri, 2 Dec 2022 14:26:46 +0100 Subject: [PATCH 228/357] Removed esp32_devkit_v1 folder --- .../espressif/boards/esp32_devkit_v1/board.c | 29 ------------ .../boards/esp32_devkit_v1/mpconfigboard.h | 45 ------------------ .../boards/esp32_devkit_v1/mpconfigboard.mk | 9 ---- ports/espressif/boards/esp32_devkit_v1/pins.c | 46 ------------------- .../boards/esp32_devkit_v1/sdkconfig | 20 -------- 5 files changed, 149 deletions(-) delete mode 100644 ports/espressif/boards/esp32_devkit_v1/board.c delete mode 100644 ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h delete mode 100644 ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk delete mode 100644 ports/espressif/boards/esp32_devkit_v1/pins.c delete mode 100644 ports/espressif/boards/esp32_devkit_v1/sdkconfig diff --git a/ports/espressif/boards/esp32_devkit_v1/board.c b/ports/espressif/boards/esp32_devkit_v1/board.c deleted file mode 100644 index 164430c88c..0000000000 --- a/ports/espressif/boards/esp32_devkit_v1/board.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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" - -// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h deleted file mode 100644 index 2a0dcd0104..0000000000 --- a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 Dan Halbert 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 "ESP32 Devkit V1" -#define MICROPY_HW_MCU_NAME "ESP32" - -#define MICROPY_HW_LED_STATUS (&pin_GPIO2) - -#define CIRCUITPY_BOARD_I2C (1) -#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO22, .sda = &pin_GPIO21}} - -#define CIRCUITPY_BOARD_SPI (1) -#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} - -#define CIRCUITPY_BOARD_UART (1) -#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO17, .rx = &pin_GPIO16}} - -// UART pins attached to the USB-serial converter chip -#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) -#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk b/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk deleted file mode 100644 index 7aa352e16e..0000000000 --- a/ports/espressif/boards/esp32_devkit_v1/mpconfigboard.mk +++ /dev/null @@ -1,9 +0,0 @@ -CIRCUITPY_CREATOR_ID = 0xB0D00000 -CIRCUITPY_CREATION_ID = 0x00320002 - -IDF_TARGET = esp32 - -CIRCUITPY_ESP_FLASH_MODE = dio -CIRCUITPY_ESP_FLASH_FREQ = 40m -CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/esp32_devkit_v1/pins.c b/ports/espressif/boards/esp32_devkit_v1/pins.c deleted file mode 100644 index 78c37897ac..0000000000 --- a/ports/espressif/boards/esp32_devkit_v1/pins.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS - - // External pins are in silkscreen order, from top to bottom, left side, then right side - {MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15)}, - {MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2)}, - {MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO16)}, - {MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO17)}, - {MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5)}, - {MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18)}, - {MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19)}, - {MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21)}, - {MP_ROM_QSTR(MP_QSTR_RX0), MP_ROM_PTR(&pin_GPIO1)}, - {MP_ROM_QSTR(MP_QSTR_TX0), MP_ROM_PTR(&pin_GPIO3)}, - {MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22)}, - {MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23)}, - {MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13)}, - {MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12)}, - {MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14)}, - {MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27)}, - {MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26)}, - {MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25)}, - {MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33)}, - {MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32)}, - {MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35)}, - {MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34)}, - - {MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2)}, - - {MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO21)}, - {MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO22)}, - - {MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18)}, - {MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23)}, - {MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19)}, - - {MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO17)}, - {MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO16)}, - - {MP_ROM_QSTR(MP_QSTR_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/esp32_devkit_v1/sdkconfig b/ports/espressif/boards/esp32_devkit_v1/sdkconfig deleted file mode 100644 index 6c0168c829..0000000000 --- a/ports/espressif/boards/esp32_devkit_v1/sdkconfig +++ /dev/null @@ -1,20 +0,0 @@ -CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y -CONFIG_ESP32_SPIRAM_SUPPORT=n - -# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins -### # -### # ESP System Settings -### # -### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y -### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set -### CONFIG_ESP_CONSOLE_UART_CUSTOM=y -### CONFIG_ESP_CONSOLE_NONE is not set -### CONFIG_ESP_CONSOLE_UART=y -### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y -### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set -### CONFIG_ESP_CONSOLE_UART_NUM=0 -### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 -### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 -### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 -### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set -### # end of ESP System Settings From b83c42e41ab6b67a42f16415ceeb93bd38ea4a79 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 2 Dec 2022 10:47:50 -0600 Subject: [PATCH 229/357] Implement the chain= argument of traceback.print_exception --- shared-bindings/traceback/__init__.c | 22 ++++++++++++++----- tests/circuitpython/traceback_test_chained.py | 5 +++-- .../traceback_test_chained.py.exp | 18 ++++++++++----- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/shared-bindings/traceback/__init__.c b/shared-bindings/traceback/__init__.c index eeb7bc458d..153587e919 100644 --- a/shared-bindings/traceback/__init__.c +++ b/shared-bindings/traceback/__init__.c @@ -58,6 +58,7 @@ STATIC void traceback_exception_common(bool is_print_exception, mp_print_t *prin } mp_obj_t tb_obj = args[ARG_tb].u_obj; mp_obj_t limit_obj = args[ARG_limit].u_obj; + bool chain = args[ARG_chain].u_bool; if (args[ARG_file].u_obj != mp_const_none) { if (!is_print_exception) { @@ -90,6 +91,15 @@ STATIC void traceback_exception_common(bool is_print_exception, mp_print_t *prin mp_obj_exception_t *exc = mp_obj_exception_get_native(value); mp_obj_traceback_t *trace_backup = exc->traceback; + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + mp_obj_exception_t *context_backup = exc->context; + mp_obj_exception_t *cause_backup = exc->cause; + + if (!chain) { + exc->context = NULL; + exc->cause = NULL; + } + #endif if (tb_obj == MP_OBJ_NULL) { /* Print the traceback's exception as is */ @@ -101,6 +111,10 @@ STATIC void traceback_exception_common(bool is_print_exception, mp_print_t *prin shared_module_traceback_print_exception(MP_OBJ_TO_PTR(value), print, limit); exc->traceback = trace_backup; + #if MICROPY_CPYTHON_EXCEPTION_CHAIN + exc->context = context_backup; + exc->cause = cause_backup; + #endif } //| def format_exception( @@ -128,14 +142,12 @@ STATIC void traceback_exception_common(bool is_print_exception, mp_print_t *prin //| these lines are concatenated and printed, exactly the same text is //| printed as does print_exception(). //| -//| .. note:: Setting ``chain`` will have no effect as chained exceptions are not yet implemented. -//| //| :param exc: The exception. Must be an instance of `BaseException`. Unused if value is specified. //| :param value: If specified, is used in place of ``exc``. //| :param TracebackType tb: When value is alsp specified, ``tb`` is used in place of the exception's own traceback. If `None`, the traceback will not be printed. //| :param int limit: Print up to limit stack trace entries (starting from the caller’s frame) if limit is positive. //| Otherwise, print the last ``abs(limit)`` entries. If limit is omitted or None, all entries are printed. -//| :param bool chain: If `True` then chained exceptions will be printed (note: not yet implemented). +//| :param bool chain: If `True` then chained exceptions will be printed. //| """ //| STATIC mp_obj_t traceback_format_exception(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -169,8 +181,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(traceback_format_exception_obj, 0, traceback_f //| no traceback will be shown. This is compatible with CPython 3.5 and //| newer. //| -//| .. note:: Setting ``chain`` will have no effect as chained exceptions are not yet implemented. -//| //| :param exc: The exception. Must be an instance of `BaseException`. Unused if value is specified. //| :param value: If specified, is used in place of ``exc``. //| :param tb: When value is alsp specified, ``tb`` is used in place of the exception's own traceback. If `None`, the traceback will not be printed. @@ -178,7 +188,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(traceback_format_exception_obj, 0, traceback_f //| Otherwise, print the last ``abs(limit)`` entries. If limit is omitted or None, all entries are printed. //| :param io.FileIO file: If file is omitted or `None`, the output goes to `sys.stderr`; otherwise it should be an open //| file or file-like object to receive the output. -//| :param bool chain: If `True` then chained exceptions will be printed (note: not yet implemented). +//| :param bool chain: If `True` then chained exceptions will be printed. //| //| """ //| ... diff --git a/tests/circuitpython/traceback_test_chained.py b/tests/circuitpython/traceback_test_chained.py index 83d0c03466..72336d7495 100644 --- a/tests/circuitpython/traceback_test_chained.py +++ b/tests/circuitpython/traceback_test_chained.py @@ -11,9 +11,9 @@ except: raise SystemExit -def print_exc_info(e): +def print_exc_info(e, chain=True): print("-" * 72) - traceback.print_exception(None, e, e.__traceback__) + traceback.print_exception(None, e, e.__traceback__, chain=chain) print("-" * 72) print() @@ -24,6 +24,7 @@ try: except Exception as inner: raise RuntimeError() from inner except Exception as e: + print_exc_info(e, chain=False) print_exc_info(e) print() diff --git a/tests/circuitpython/traceback_test_chained.py.exp b/tests/circuitpython/traceback_test_chained.py.exp index c874ff707f..5fa40126b3 100644 --- a/tests/circuitpython/traceback_test_chained.py.exp +++ b/tests/circuitpython/traceback_test_chained.py.exp @@ -1,3 +1,9 @@ +------------------------------------------------------------------------ +Traceback (most recent call last): + File "circuitpython/traceback_test_chained.py", line 25, in +RuntimeError: +------------------------------------------------------------------------ + ------------------------------------------------------------------------ Traceback (most recent call last): File "circuitpython/traceback_test_chained.py", line 23, in @@ -17,39 +23,39 @@ OSError: The above exception was the direct cause of the following exception: Traceback (most recent call last): - File "circuitpython/traceback_test_chained.py", line 34, in + File "circuitpython/traceback_test_chained.py", line 35, in RuntimeError: ------------------------------------------------------------------------ ------------------------------------------------------------------------ Traceback (most recent call last): - File "circuitpython/traceback_test_chained.py", line 42, in + File "circuitpython/traceback_test_chained.py", line 43, in ZeroDivisionError: division by zero During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "circuitpython/traceback_test_chained.py", line 44, in + File "circuitpython/traceback_test_chained.py", line 45, in RuntimeError: ------------------------------------------------------------------------ ------------------------------------------------------------------------ Traceback (most recent call last): - File "circuitpython/traceback_test_chained.py", line 53, in + File "circuitpython/traceback_test_chained.py", line 54, in RuntimeError: ------------------------------------------------------------------------ ------------------------------------------------------------------------ Traceback (most recent call last): - File "circuitpython/traceback_test_chained.py", line 59, in + File "circuitpython/traceback_test_chained.py", line 60, in RuntimeError: During handling of the above exception, another exception occurred: Traceback (most recent call last): - File "circuitpython/traceback_test_chained.py", line 61, in + File "circuitpython/traceback_test_chained.py", line 62, in ZeroDivisionError: division by zero ------------------------------------------------------------------------ From f7504ff857f597a4b18502d759a2a31159b3bc30 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 2 Dec 2022 10:19:31 -0800 Subject: [PATCH 230/357] Tweaks based on review comments --- ports/raspberrypi/common-hal/analogbufio/BufferedIn.c | 5 +++-- shared-bindings/analogbufio/BufferedIn.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c index 1b0a0d684a..bc5f9028b7 100644 --- a/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c +++ b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c @@ -79,7 +79,6 @@ void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *s // sample_rate is forced to be >= 1 in shared-bindings float clk_div = (float)ADC_CLOCK_INPUT / (float)sample_rate; - mp_printf(&mp_plat_print, "clk_div %f for %d\n", (double)clk_div, sample_rate); adc_set_clkdiv(clk_div); // Set up the DMA to start transferring data as soon as it appears in FIFO @@ -122,7 +121,9 @@ uint32_t common_hal_analogbufio_bufferedin_readinto(analogbufio_bufferedin_obj_t // RP2040 Implementation Detail // Fills the supplied buffer with ADC values using DMA transfer. // If the buffer is 8-bit, then values are 8-bit shifted and error bit is off. - // If buffer is 16-bit, then values are not shifted and error bit is present. + // If buffer is 16-bit, then values are 12-bit and error bit is present. We + // stretch the 12-bit value to 16-bits and truncate the number of valid + // samples at the first sample with the error bit set. // Number of transfers is always the number of samples which is the array // byte length divided by the bytes_per_sample. uint dma_size = DMA_SIZE_8; diff --git a/shared-bindings/analogbufio/BufferedIn.c b/shared-bindings/analogbufio/BufferedIn.c index d6c6b4a46e..193552c313 100644 --- a/shared-bindings/analogbufio/BufferedIn.c +++ b/shared-bindings/analogbufio/BufferedIn.c @@ -47,7 +47,7 @@ //| import array //| //| length = 1000 -//| mybuffer = array.array("H", 0x0000 for i in range(length)) +//| mybuffer = array.array("H", [0x0000] * length) //| rate = 500000 //| adcbuf = analogbufio.BufferedIn(board.GP26, sample_rate=rate) //| adcbuf.readinto(mybuffer) From 54831ae692a0455e81329cd2bdfc5df2d6c7edd8 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 2 Dec 2022 14:23:46 +0000 Subject: [PATCH 231/357] Translated using Weblate (Swedish) Currently translated at 100.0% (986 of 986 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index cb0a0daf8e..8a19545c06 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-12-02 01:55+0000\n" +"PO-Revision-Date: 2022-12-02 22:53+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -489,7 +489,7 @@ msgstr "Kör redan" #: ports/espressif/common-hal/wifi/Radio.c #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "Skannar redan efter wifi-nätverk" +msgstr "Skannar redan efter WiFi-nätverk" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" @@ -1988,7 +1988,7 @@ msgstr "Höger stereokanal måste använda PWM kanal B" #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Stopping AP is not supported." -msgstr "" +msgstr "Stoppa AP stöds inte." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" @@ -2400,15 +2400,15 @@ msgstr "Wi-Fi: " #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in access point mode." -msgstr "" +msgstr "WiFi är i accesspunktläge." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in station mode." -msgstr "" +msgstr "WiFi är i stationsläge." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is not enabled" -msgstr "" +msgstr "WiFi är inte aktiverat" #: main.c msgid "Woken up by alarm.\n" @@ -4290,7 +4290,7 @@ msgstr "width måste vara större än noll" #: ports/espressif/common-hal/wifi/Radio.c #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "wifi is not enabled" -msgstr "wifi är inte aktiverat" +msgstr "WiFi är inte aktiverat" #: ports/raspberrypi/common-hal/wifi/Monitor.c msgid "wifi.Monitor not available" From 248c17d8bf9b50085a22b6bc7f7c59f3278993ff Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 2 Dec 2022 23:53:24 +0100 Subject: [PATCH 232/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 3 +++ locale/cs.po | 3 +++ locale/de_DE.po | 3 +++ locale/el.po | 3 +++ locale/en_GB.po | 3 +++ locale/es.po | 3 +++ locale/fil.po | 3 +++ locale/fr.po | 3 +++ locale/hi.po | 3 +++ locale/it_IT.po | 3 +++ locale/ja.po | 3 +++ locale/ko.po | 3 +++ locale/nl.po | 3 +++ locale/pl.po | 3 +++ locale/pt_BR.po | 3 +++ locale/ru.po | 3 +++ locale/sv.po | 3 +++ locale/tr.po | 3 +++ locale/zh_Latn_pinyin.po | 3 +++ 19 files changed, 57 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 3b169152f5..eb8effacb8 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -161,6 +161,9 @@ msgid "%q must be >= %d" msgstr "%q harus >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index e7906f40a0..67307d5715 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -162,6 +162,9 @@ msgid "%q must be >= %d" msgstr "%q musí být >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 5310fda215..cc1c20f2c0 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -163,6 +163,9 @@ msgid "%q must be >= %d" msgstr "%q muss >= %d sein" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/el.po b/locale/el.po index 85a0bb31ff..b187a003c1 100644 --- a/locale/el.po +++ b/locale/el.po @@ -167,6 +167,9 @@ msgid "%q must be >= %d" msgstr "%q πρέπει να είναι >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q πρέπει να είναι bytearray ή array τύπου 'h', 'H', 'b', ή 'B'" diff --git a/locale/en_GB.po b/locale/en_GB.po index a349cfa422..07c9e578c8 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -165,6 +165,9 @@ msgid "%q must be >= %d" msgstr "%q must be >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/es.po b/locale/es.po index 5016035bc1..f160e99a86 100644 --- a/locale/es.po +++ b/locale/es.po @@ -167,6 +167,9 @@ msgid "%q must be >= %d" msgstr "%q debe ser >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 246a7e2c81..988c921bfb 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -156,6 +156,9 @@ msgid "%q must be >= %d" msgstr "" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index b964b6e301..605e4e8eaa 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -167,6 +167,9 @@ msgid "%q must be >= %d" msgstr "%q doit être >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q doit être a bytearray ou array de type 'h', 'H', 'b', ou 'B'" diff --git a/locale/hi.po b/locale/hi.po index c4b1d62139..bd4f497f7b 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -155,6 +155,9 @@ msgid "%q must be >= %d" msgstr "" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 784d7723a8..8a0d5cc526 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -162,6 +162,9 @@ msgid "%q must be >= %d" msgstr "" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 47caa45a91..56e1272396 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -160,6 +160,9 @@ msgid "%q must be >= %d" msgstr "" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 7106244843..0e6aa1ed34 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -156,6 +156,9 @@ msgid "%q must be >= %d" msgstr "" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 35fcd7e8cd..4759dce824 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -158,6 +158,9 @@ msgid "%q must be >= %d" msgstr "" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index e001f37108..27ab7e4062 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -160,6 +160,9 @@ msgid "%q must be >= %d" msgstr "" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f89157c53b..4d80147319 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -164,6 +164,9 @@ msgid "%q must be >= %d" msgstr "o %q deve ser >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q deve ser um bytearray ou uma matriz do tipo 'h', 'H', 'b', ou 'B'" diff --git a/locale/ru.po b/locale/ru.po index 6536c624ff..1845bcb929 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -166,6 +166,9 @@ msgid "%q must be >= %d" msgstr "%q должно быть >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q должно быть bytearray или array типа 'h', 'H', 'b', или 'B'" diff --git a/locale/sv.po b/locale/sv.po index 8a19545c06..e5fad3a908 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -163,6 +163,9 @@ msgid "%q must be >= %d" msgstr "%q måste vara >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" diff --git a/locale/tr.po b/locale/tr.po index f2d0e00c1e..8381a79c14 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -167,6 +167,9 @@ msgid "%q must be >= %d" msgstr "%q >= %d olmalıdır" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q 'h', 'H', 'b' yada 'B' tipi bir bytearray /array olmalı" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 93542306cb..e641213935 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -166,6 +166,9 @@ msgid "%q must be >= %d" msgstr "%q bìxū >= %d" #: shared-bindings/analogbufio/BufferedIn.c +msgid "%q must be a bytearray or array of type 'H' or 'B'" +msgstr "" + #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" From afb5301cef6d06e5932dbc9bad64062bf9d4ca3c Mon Sep 17 00:00:00 2001 From: BooleanMattock <118489982+BooleanMattock@users.noreply.github.com> Date: Fri, 2 Dec 2022 20:21:40 -0500 Subject: [PATCH 233/357] Fix to Issue #7224 - tested --- ports/raspberrypi/common-hal/pwmio/PWMOut.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index e6f88f8894..f75c4b3451 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -236,14 +236,6 @@ extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uin } // compare_count is the CC register value, which should be TOP+1 for 100% duty cycle. pwm_set_chan_level(self->slice, self->ab_channel, compare_count); - // Wait for wrap so that we know our new cc value has been applied. Clear - // the internal interrupt and then wait for it to be set. Worst case, we - // wait a full cycle. - pwm_hw->intr = 1 << self->slice; - while ((pwm_hw->en & (1 << self->slice)) != 0 && - (pwm_hw->intr & (1 << self->slice)) == 0 && - !mp_hal_is_interrupted()) { - } } uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t *self) { From 51df14896bf5df86cc23b68e0aeb2ead7fa89803 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sat, 3 Dec 2022 17:13:26 +0000 Subject: [PATCH 234/357] Translated using Weblate (Swedish) Currently translated at 100.0% (987 of 987 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index e5fad3a908..df1ab4a177 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-12-02 22:53+0000\n" +"PO-Revision-Date: 2022-12-04 17:47+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -164,7 +164,7 @@ msgstr "%q måste vara >= %d" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q måste vara en bytearray eller array av typen 'H' eller 'B'" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" From 05a8bf8c38513ee329416b7a3f7a44b6ea167c97 Mon Sep 17 00:00:00 2001 From: evildave666 Date: Mon, 5 Dec 2022 16:06:50 +0900 Subject: [PATCH 235/357] Create board.c --- .../boards/luatos_core_esp32c3/board.c | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ports/espressif/boards/luatos_core_esp32c3/board.c diff --git a/ports/espressif/boards/luatos_core_esp32c3/board.c b/ports/espressif/boards/luatos_core_esp32c3/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/luatos_core_esp32c3/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. From 5b6f06d84c4a6f1e09d9daef792f0a3a8380ea49 Mon Sep 17 00:00:00 2001 From: evildave666 Date: Mon, 5 Dec 2022 16:08:12 +0900 Subject: [PATCH 236/357] Add additional files --- .../luatos_core_esp32c3/mpconfigboard.h | 38 +++++++++++++++++ .../luatos_core_esp32c3/mpconfigboard.mk | 8 ++++ .../boards/luatos_core_esp32c3/pins.c | 42 +++++++++++++++++++ .../boards/luatos_core_esp32c3/sdkconfig | 5 +++ 4 files changed, 93 insertions(+) create mode 100644 ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.h create mode 100644 ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk create mode 100644 ports/espressif/boards/luatos_core_esp32c3/pins.c create mode 100644 ports/espressif/boards/luatos_core_esp32c3/sdkconfig diff --git a/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.h b/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.h new file mode 100644 index 0000000000..23bb5ee9b2 --- /dev/null +++ b/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.h @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Board setup + +#define MICROPY_HW_BOARD_NAME "Luatos Core-ESP32C3" +#define MICROPY_HW_MCU_NAME "ESP32-C3" + +// Status LED +#define MICROPY_HW_LED_STATUS (&pin_GPIO12) + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk b/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk new file mode 100644 index 0000000000..29f1719153 --- /dev/null +++ b/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0xDEADBEEF +CIRCUITPY_CREATION_ID = 0x00C30001 + +IDF_TARGET = esp32c3 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=4MB diff --git a/ports/espressif/boards/luatos_core_esp32c3/pins.c b/ports/espressif/boards/luatos_core_esp32c3/pins.c new file mode 100644 index 0000000000..59b1d706b3 --- /dev/null +++ b/ports/espressif/boards/luatos_core_esp32c3/pins.c @@ -0,0 +1,42 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // Luatos Core ESP32-C3 + // Documentation: + // https://wiki.luatos.com/chips/esp32c3/index.html + // Pinout: + // https://wiki.luatos.com/_images/20221023.png + // C3 Data Sheet + // https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { 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_IO8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + + { 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/luatos_core_esp32c3/sdkconfig b/ports/espressif/boards/luatos_core_esp32c3/sdkconfig new file mode 100644 index 0000000000..ccc70917b5 --- /dev/null +++ b/ports/espressif/boards/luatos_core_esp32c3/sdkconfig @@ -0,0 +1,5 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="luatos-core-esp32c3" +# end of LWIP From 14b430ed3534ad9ffe0e143d76eb75eca4297068 Mon Sep 17 00:00:00 2001 From: evildave666 Date: Mon, 5 Dec 2022 16:35:48 +0900 Subject: [PATCH 237/357] Fix pre-commit issues --- ports/espressif/boards/luatos_core_esp32c3/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/luatos_core_esp32c3/pins.c b/ports/espressif/boards/luatos_core_esp32c3/pins.c index 59b1d706b3..fed05323e8 100644 --- a/ports/espressif/boards/luatos_core_esp32c3/pins.c +++ b/ports/espressif/boards/luatos_core_esp32c3/pins.c @@ -4,7 +4,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // Luatos Core ESP32-C3 - // Documentation: + // Documentation (Chinese only): // https://wiki.luatos.com/chips/esp32c3/index.html // Pinout: // https://wiki.luatos.com/_images/20221023.png From eaf39b4c1007eb0a93a9f810c5f8ea4a950563bf Mon Sep 17 00:00:00 2001 From: evildave666 Date: Mon, 5 Dec 2022 16:40:36 +0900 Subject: [PATCH 238/357] Update pins.c --- ports/espressif/boards/luatos_core_esp32c3/pins.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ports/espressif/boards/luatos_core_esp32c3/pins.c b/ports/espressif/boards/luatos_core_esp32c3/pins.c index fed05323e8..b472446fe2 100644 --- a/ports/espressif/boards/luatos_core_esp32c3/pins.c +++ b/ports/espressif/boards/luatos_core_esp32c3/pins.c @@ -20,23 +20,17 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { 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_IO8), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO12) }, - { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From d080f81ffee36bbedbb78c56e4ee35943971ea4b Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sun, 4 Dec 2022 21:20:22 +0000 Subject: [PATCH 239/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (987 of 987 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 4d80147319..7ef7f2109f 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-11-11 18:49+0000\n" +"PO-Revision-Date: 2022-12-05 21:48+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -165,7 +165,7 @@ msgstr "o %q deve ser >= %d" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q deve ser um bytearray ou uma matriz do tipo 'H' ou 'B'" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" @@ -203,7 +203,7 @@ msgstr "%q pino inválido" #: py/objrange.c py/objslice.c shared-bindings/random/__init__.c msgid "%q step cannot be zero" -msgstr "" +msgstr "A etapa %q não pode ser zero" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -910,7 +910,7 @@ msgstr "O modo do controlador não é usado quando a direção for inserida." #: py/obj.c msgid "During handling of the above exception, another exception occurred:" -msgstr "" +msgstr "Outra exceção ocorreu durante o tratamento da exceção acima:" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" @@ -1693,7 +1693,7 @@ msgstr "A operação expirou" #: ports/raspberrypi/common-hal/mdns/Server.c msgid "Out of MDNS service slots" -msgstr "" +msgstr "Sem slots do serviço MDNS" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" @@ -2011,7 +2011,7 @@ msgstr "O estéreo à direita deve estar no canal PWM B" #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Stopping AP is not supported." -msgstr "" +msgstr "Não há suporte para a interrupção do AP." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" @@ -2060,7 +2060,7 @@ msgstr "" #: py/obj.c msgid "The above exception was the direct cause of the following exception:" -msgstr "" +msgstr "A exceção acima foi a causa direta da seguinte exceção:" #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h msgid "The central button was pressed at start up.\n" @@ -2430,15 +2430,15 @@ msgstr "Wi-Fi: " #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in access point mode." -msgstr "" +msgstr "O Wi-Fi está em modo de ponto de acesso." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in station mode." -msgstr "" +msgstr "O Wi-Fi está em modo estação." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is not enabled" -msgstr "" +msgstr "O Wi-Fi não está ativado" #: main.c msgid "Woken up by alarm.\n" @@ -3239,7 +3239,7 @@ msgstr "o índice está fora dos limites" #: shared-bindings/adafruit_pixelbuf/PixelMap.c msgid "index must be tuple or int" -msgstr "" +msgstr "o índice deve ser tupla ou int" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c @@ -3624,7 +3624,7 @@ msgstr "contagem de turnos negativos" #: shared-bindings/adafruit_pixelbuf/PixelMap.c msgid "nested index must be int" -msgstr "" +msgstr "o índice aninhado deve ser int" #: shared-module/sdcardio/SDCard.c msgid "no SD card" From 1e34fc110aa8af6f6827547d7a4118494562d860 Mon Sep 17 00:00:00 2001 From: Boran Roni Date: Sun, 4 Dec 2022 18:17:43 +0000 Subject: [PATCH 240/357] Translated using Weblate (Turkish) Currently translated at 26.7% (264 of 987 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/tr/ --- locale/tr.po | 258 ++++++++++++++++++++++++++------------------------- 1 file changed, 132 insertions(+), 126 deletions(-) diff --git a/locale/tr.po b/locale/tr.po index 8381a79c14..feb86500fe 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-10-10 18:23+0000\n" +"PO-Revision-Date: 2022-12-05 21:48+0000\n" "Last-Translator: Boran Roni \n" "Language-Team: none\n" "Language: tr\n" @@ -15,7 +15,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.14.1\n" +"X-Generator: Weblate 4.15-dev\n" #: main.c msgid "" @@ -73,7 +73,7 @@ msgstr "%%c int veya char tipine ihtiyaç duyar" #: main.c #, c-format msgid "%02X" -msgstr "" +msgstr "%02X" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -128,7 +128,7 @@ msgstr "%q init başarısız oldu" #: shared-bindings/dualbank/__init__.c msgid "%q is %q" -msgstr "" +msgstr "%q %q dir" #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" @@ -168,11 +168,11 @@ msgstr "%q >= %d olmalıdır" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q 'H' ya da 'B' tipi bir bytearray ya da array olmalıdır" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" -msgstr "%q 'h', 'H', 'b' yada 'B' tipi bir bytearray /array olmalı" +msgstr "%q 'h', 'H', 'b' ya da 'B' tipi bir bytearray ya da array olmalı" #: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" @@ -206,7 +206,7 @@ msgstr "%q pini geçersiz" #: py/objrange.c py/objslice.c shared-bindings/random/__init__.c msgid "%q step cannot be zero" -msgstr "" +msgstr "%q sıfır olamaz" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -559,18 +559,17 @@ msgstr "Minimum kare hızından altında" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "" +msgstr "Bit saati ve kelime seçimi pinleri sıralı olmalıdır" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" -msgstr "" +msgstr "Bit saati ve kelime seçimi, bir saat birimini paylaşmalıdır" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit derinliği 8'in katı olacak şekilde olmalı." #: shared-bindings/bitmaptools/__init__.c -#, fuzzy msgid "Bitmap size and bits per value must match" msgstr "Bitmap boyutu ve bit başına değer uyuşmalı" @@ -587,11 +586,11 @@ msgstr "Hem RX hem de TX akış kontrolü için gerekli" #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "Both buttons were pressed at start up.\n" -msgstr "" +msgstr "Başlatma sırasında her iki düğmeye de basıldı.\n" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "" +msgstr "Her iki pin de donanım kesintilerini desteklemelidir" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -657,7 +656,7 @@ msgstr "Veriyolu pini %d kullanımda" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "Button A was pressed at start up.\n" -msgstr "" +msgstr "Başlatma sırasında A düğmesine basıldı.\n" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -677,7 +676,7 @@ msgstr "CRC yada checksum geçersiz" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Yerel nesneye erişmeden önce super().__init__() fonksiyonunu çağırın." #: ports/cxd56/common-hal/camera/Camera.c msgid "Camera init" @@ -707,7 +706,7 @@ msgstr "USB aygıtları şu an değiştirilemez" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "Yeni Adapter oluşturulamaz, _bleio.adapter; kullanın" +msgstr "yeni Adaptör oluşturulamadı, _bleio.adapter kullanın" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -737,30 +736,30 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" -msgstr "" +msgstr "Dosyaya kayıt yapılamıyor" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when visible via USB." -msgstr "" +msgstr "'/' USB ile görünür olduğunda, yeniden bağlanamaz." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present" -msgstr "" +msgstr "Hiçbir bootloader bulunmadığından bootloader sıfırlanamıyor" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" -msgstr "" +msgstr "Soket seçenekleri ayarlanamıyor" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "Yön, giriş olduğunda değer ayarlanamıyor." #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "RS485 modunda RTS veya CTS belirtilemez" #: py/objslice.c msgid "Cannot subclass slice" @@ -768,11 +767,11 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins" -msgstr "" +msgstr "MOSI ve MISO pinleri olmadan transfer edilemiyor" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "Kullanımda olan bir zamanlayıcının frekansı değiştirilemez" #: ports/nrf/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge, only level" @@ -784,7 +783,7 @@ msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "CharacteristicBuffer yazılmı sağlanmadı" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" @@ -796,7 +795,7 @@ msgstr "" #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "" +msgstr "Saat uzatması çok uzun" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" @@ -818,7 +817,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Adres ayarlanamadı" #: shared-bindings/pwmio/PWMOut.c msgid "Could not start PWM" @@ -826,7 +825,7 @@ msgstr "PWM başlatılamadı" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Kesinti başlatılamadı, RX kullanımda" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" @@ -846,16 +845,16 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "" +msgstr "DAC zaten kullanımda" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "Data 0 pini bite hizalı olmalı" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" -msgstr "" +msgstr "Veri öbeği, fmt yığınını takip etmelidir" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -873,38 +872,38 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "Hedef kapasitesi, hedef_uzunluğundan daha küçük." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Cihaz kullanımda" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "Ekran 16 bitlik bir renk uzayına sahip olmalıdır." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" -msgstr "" +msgstr "Ekran dönüşü 90 derecelik artışlarla olmalıdır" #: main.c msgid "Done" -msgstr "" +msgstr "Tamamlandı" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "" +msgstr "Yön, giriş olduğunda sürüş modu kullanılmaz." #: py/obj.c msgid "During handling of the above exception, another exception occurred:" -msgstr "" +msgstr "Yukarıdaki hatanın işlenmesi sırasında başka bir hata oluştu:" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB aynı anda yalnızca 16 baytla çalışır" #: ports/espressif/common-hal/busio/SPI.c #: ports/espressif/common-hal/canio/CAN.c @@ -916,20 +915,20 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" -msgstr "" +msgstr "EXTINT kanalı zaten kullanımda" #: shared-module/synthio/MidiTrack.c #, c-format msgid "Error in MIDI stream at position %d" -msgstr "" +msgstr "%d konumundaki MIDI akışında hata" #: extmod/modure.c msgid "Error in regex" -msgstr "" +msgstr "regex'te hata" #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" -msgstr "" +msgstr "Hata: Bağlanamadı" #: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c @@ -937,15 +936,15 @@ msgstr "" #: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" -msgstr "" +msgstr "%q bekleniyor" #: ports/raspberrypi/bindings/cyw43/__init__.c msgid "Expected a %q or %q" -msgstr "" +msgstr "%q yada %q bekleniyor" #: shared-bindings/alarm/__init__.c msgid "Expected an %q" -msgstr "" +msgstr "%q bekleniyor" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -954,24 +953,24 @@ msgstr "" #: extmod/ulab/code/numpy/fft/fft_tools.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT sadece ndarrays'te tanımlandı" #: extmod/ulab/code/numpy/fft/fft_tools.c msgid "FFT is implemented for linear arrays only" -msgstr "" +msgstr "FFT yalnızca doğrusal diziler için uygulanır" #: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "SSL el sıkışma hatası" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "Komut gönderilemedi." #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "" +msgstr "Muteks alınamadı, err 0x%04x" #: shared-module/rgbmatrix/RGBMatrix.c msgid "Failed to allocate %q buffer" @@ -992,24 +991,24 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Bağlantı kurulamadı: internal error" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Bağlantı kurulamadı: timeout" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "MP3 dosyası ayrıştırılamadı" #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" -msgstr "" +msgstr "Muteks serbest bırakılamadı, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Dahili flaş yazılamadı." #: supervisor/shared/safe_mode.c msgid "Fatal error." @@ -1017,13 +1016,13 @@ msgstr "" #: py/moduerrno.c msgid "File exists" -msgstr "" +msgstr "Dosya var" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Filtreler çok karmaşık" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is duplicate" @@ -1031,42 +1030,46 @@ msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is invalid" -msgstr "" +msgstr "Yazılım geçersiz" #: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" -msgstr "" +msgstr "Yazılım çok büyük" #: shared-bindings/bitmaptools/__init__.c msgid "For L8 colorspace, input bitmap must have 8 bits per pixel" msgstr "" +"L8 renk uzayı için, giriş bitmap'i piksel başına 8 bayta sahip olmalıdır" #: shared-bindings/bitmaptools/__init__.c msgid "For RGB colorspaces, input bitmap must have 16 bits per pixel" msgstr "" +"RGB renk uzayı için, giriş bitmap'i piksel başına 16 bayta sahip olmalıdır" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Format desteklenmiyor" #: ports/mimxrt10xx/common-hal/microcontroller/Processor.c msgid "" "Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" +"Frekans 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 ya da 1008 Mhz " +"olmalıdır" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "" +msgstr "Frekans, bu zamanlayıcıyı kullanan mevcut PWMOut ile eşleşmelidir" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" -msgstr "" +msgstr "Fonksiyon kilit gerektirir" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "GNSS init" -msgstr "" +msgstr "GNSS init" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" @@ -1076,7 +1079,7 @@ msgstr "" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "Grup zaten kullanılıyor" #: ports/atmel-samd/common-hal/busio/SPI.c ports/cxd56/common-hal/busio/SPI.c #: ports/espressif/common-hal/busio/SPI.c @@ -1089,201 +1092,204 @@ msgstr "" #: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c #: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Donanım meşgul, alternatif pinleri deneyin" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Donanım kullanımda, alternatif pinleri deneyin" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" -msgstr "" +msgstr "Kapalı dosyada I/O işlemi" #: ports/stm/common-hal/busio/I2C.c msgid "I2C init error" -msgstr "" +msgstr "I2C init hatası" #: ports/raspberrypi/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" -msgstr "" +msgstr "I2C çevre cihazı kullanımda" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut uygundeğil" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV %d bayt uzunluğunda olmalı" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "In-buffer elements must be <= 4 bytes long" -msgstr "" +msgstr "Buffer öğeleri <=4 bayt uzunluğunda olmalı" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"Uyumsuz .mpy dosyası. Lütfen tüm .mpy dosyalarını güncelleyin. Daha fazla " +"bilgi için http://adafru.it/mpy-update ." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "Yanlış buffer size" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Init program size invalid" -msgstr "" +msgstr "Init program boyutu geçersiz" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin direction conflicts with initial out pin direction" -msgstr "" +msgstr "İlk pin yönü, ilk çıkış pin yönüyle çakışıyor" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Initial set pin state conflicts with initial out pin state" -msgstr "" +msgstr "İlk pinin durumu, ilk çıkış pininin durumu ile çakışıyor" #: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" -msgstr "" +msgstr "Bellek yetersizliği nedeniyle başlatma başarısız oldu" #: shared-bindings/bitops/__init__.c #, c-format msgid "Input buffer length (%d) must be a multiple of the strand count (%d)" -msgstr "" +msgstr "Giriş buffer uzunluğu (%d) strand sayımının (%d) katı olmalıdır" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Giriş çok uzun sürüyor" #: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "Giriş/çıkış hatası" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" -msgstr "" +msgstr "Komut %d pin sayısından daha fazla bit içe kaydırıyor" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts out more bits than pin count" -msgstr "" +msgstr "Komut %d pin sayısından daha fazla bit dışa kaydırıyor" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d uses extra pin" -msgstr "" +msgstr "Komut %d extra pin kullanıyor" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d waits on input outside of count" -msgstr "" +msgstr "Komut %d sayım dışında, girişte bekler" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Yetersiz kimlik doğrulama" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Yetersiz şifreleme" #: ports/espressif/common-hal/wifi/Radio.c msgid "Interface must be started" -msgstr "" +msgstr "Arayüz başlatılmalıdır" #: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c msgid "Internal audio buffer too small" -msgstr "" +msgstr "Dahili ses arabelleği çok küçük" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Dahili tanımlama hatası" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Internal error" -msgstr "" +msgstr "Dahili hata" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Dahili hata #%d" #: supervisor/shared/safe_mode.c msgid "Internal watchdog timer expired." -msgstr "" +msgstr "Dahili bekçi zamanlayıcısının süresi doldu." #: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c msgid "Invalid %q" -msgstr "" +msgstr "Geçersiz %q" #: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" -msgstr "" +msgstr "Geersi %q pin" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Geçersiz ADC Ünite değeri" #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" -msgstr "" +msgstr "Geçersiz BLE parametresi" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Geçersiz BSSID" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" -msgstr "" +msgstr "Geçersiz MAC adresi" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c msgid "Invalid argument" -msgstr "" +msgstr "Geçersiz argüman" #: shared-module/displayio/Bitmap.c +#, fuzzy msgid "Invalid bits per value" -msgstr "" +msgstr "Geçersiz bit başına değer" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" -msgstr "" +msgstr "Geçersiz veri_pini [%d]" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" -msgstr "" +msgstr "Geçersiz biçim yığın boyutu" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Geçersiz bellek erişimi." #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" -msgstr "" +msgstr "Geçersiz multicast MAC adresi" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" -msgstr "" +msgstr "Geçersiz boyut" #: ports/espressif/common-hal/ssl/SSLContext.c #: ports/raspberrypi/common-hal/ssl/SSLSocket.c msgid "Invalid socket for TLS" -msgstr "" +msgstr "TLS için geçersiz soket" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" -msgstr "" +msgstr "Geçersiz durum" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Anahtar 16, 24 veya 32 bayt uzunluğunda olmalıdır" #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" -msgstr "" +msgstr "LED eşlemeleri ekran boyutuyla eşleşmelidir" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1291,24 +1297,24 @@ msgstr "" #: shared-module/displayio/Group.c msgid "Layer already in a group" -msgstr "" +msgstr "Katman zaten bir grupta" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass" -msgstr "" +msgstr "Katman, bir Grup ya da TileGrid alt sınıfı olmalıdır" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" -msgstr "" +msgstr "MAC adresi geçersiz" #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" -msgstr "" +msgstr "Map tuple olmalıdır" #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" +msgstr "İkizlendiğinde maksimum x değeri %d'dir" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1325,11 +1331,11 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Eksik MISO veya MOSI pini" #: ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI pin" -msgstr "" +msgstr "Eksik MISO veya MOSI pini" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1385,11 +1391,11 @@ msgstr "" #: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" -msgstr "" +msgstr "NVS hatası" #: py/qstr.c msgid "Name too long" -msgstr "" +msgstr "İsim çok uzun" #: shared-bindings/displayio/TileGrid.c msgid "New bitmap must be same size as old bitmap" @@ -1427,43 +1433,43 @@ msgstr "" #: supervisor/shared/web_workflow/web_workflow.c msgid "No IP" -msgstr "" +msgstr "IP yok" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "MISO pini yok" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MISO pin" -msgstr "" +msgstr "MISO pini yok" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "MOSI pini yok" #: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c msgid "No MOSI pin" -msgstr "" +msgstr "MOSI pini yok" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "No RX pin" -msgstr "" +msgstr "RX pini yok" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "No TX pin" -msgstr "" +msgstr "TX pini yok" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Kullanılabilir saat yok" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "No capture in progress" From b354cec8cb0a70896c3f2aee080f68e08e8849fd Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 6 Dec 2022 11:49:04 -0800 Subject: [PATCH 241/357] Three small ESP web workflow fixes * Set nonblock on all accepted sockets. Not just ones for user code. * Close an open websocket if another is accepted. * Set debug level to INFO rather than DEBUG because DEBUG crashes on ESP32-S3 USB OTG. --- ports/espressif/common-hal/socketpool/Socket.c | 2 +- ports/espressif/esp-idf-config/sdkconfig-debug.defaults | 8 ++++---- supervisor/shared/web_workflow/websocket.c | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index 5f34d674b2..abb5124e0f 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -285,6 +285,7 @@ int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_ accepted->num = newsoc; accepted->pool = self->pool; accepted->connected = true; + lwip_fcntl(newsoc, F_SETFL, O_NONBLOCK); } return newsoc; @@ -303,7 +304,6 @@ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_o sock->pool = self->pool; sock->connected = true; - lwip_fcntl(newsoc, F_SETFL, O_NONBLOCK); return sock; } else { mp_raise_OSError(-newsoc); diff --git a/ports/espressif/esp-idf-config/sdkconfig-debug.defaults b/ports/espressif/esp-idf-config/sdkconfig-debug.defaults index e93b3d2825..bef5ee5fe8 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-debug.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-debug.defaults @@ -8,8 +8,8 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set -CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG=y +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set # end of Bootloader config @@ -72,8 +72,8 @@ CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set -CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set # end of Log output diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c index 9d1cf9919f..7612066fa6 100644 --- a/supervisor/shared/web_workflow/websocket.c +++ b/supervisor/shared/web_workflow/websocket.c @@ -57,11 +57,15 @@ static _websocket cp_serial; void websocket_init(void) { socketpool_socket_reset(&cp_serial.socket); + cp_serial.closed = true; ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf) - 1); } void websocket_handoff(socketpool_socket_obj_t *socket) { + if (!cp_serial.closed) { + common_hal_socketpool_socket_close(&cp_serial.socket); + } socketpool_socket_move(socket, &cp_serial.socket); cp_serial.closed = false; cp_serial.opcode = 0; From 3965ef9c2a39904a7b2e429faf636b8b9acc5b82 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 6 Dec 2022 19:27:00 -0500 Subject: [PATCH 242/357] make esp32-box-lite sdkconfig same as box --- .../mpconfigboard.mk | 8 +++-- .../espressif_esp32s3_box_lite/sdkconfig | 36 ++++--------------- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk index 2e63089b9c..f4a746026a 100644 --- a/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk @@ -5,6 +5,8 @@ USB_MANUFACTURER = "Espressif" IDF_TARGET = esp32s3 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB + +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig b/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig index 7fcf8ef297..ead0088da5 100644 --- a/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig @@ -1,35 +1,11 @@ -CONFIG_ESP32S3_SPIRAM_SUPPORT=y -# -# SPI RAM config -# -# CONFIG_SPIRAM_MODE_QUAD is not set -CONFIG_SPIRAM_MODE_OCT=y -CONFIG_SPIRAM_TYPE_AUTO=y -# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -CONFIG_SPIRAM_SIZE=-1 -# 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_MODE_OCT=y +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_TYPE_AUTO=y + CONFIG_SPIRAM_BOOT_INIT=y -# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -# CONFIG_SPIRAM_USE_MEMMAP is not set -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -CONFIG_SPIRAM_USE_MALLOC=y -CONFIG_SPIRAM_MEMTEST=y -CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 -# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set -CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +CONFIG_SPIRAM_USE_MEMMAP=y + # # LWIP # From ff8d051eff97d55a5a41e2ff6dcfeb6c3f1e9506 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 7 Dec 2022 13:28:34 -0600 Subject: [PATCH 243/357] Add an additional large delay time at start for pico w boards --- ports/raspberrypi/supervisor/port.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index f6ddab2c12..05d53fcc8d 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -62,6 +62,7 @@ #include "src/rp2_common/hardware_sync/include/hardware/sync.h" #include "src/rp2_common/hardware_timer/include/hardware/timer.h" #if CIRCUITPY_CYW43 +#include "py/mphal.h" #include "pico/cyw43_arch.h" #endif #include "src/common/pico_time/include/pico/time.h" @@ -143,6 +144,11 @@ safe_mode_t port_init(void) { never_reset_pin_number(24); never_reset_pin_number(25); never_reset_pin_number(29); + // A small number of samples of pico w need an additional delay before + // initializing the cyw43 chip. Delays inside cyw43_arch_init_with_country + // are intended to meet the power on timing requirements, but apparently + // are inadequate. We'll back off this long delay based on future testing. + mp_hal_delay_ms(1000); // Change this as a placeholder as to how to init with country code. // Default country code is CYW43_COUNTRY_WORLDWIDE) if (cyw43_arch_init_with_country(PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE)) { From a1dd8405f4648fdffc29e7a3ead8781d7fdb296c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 7 Dec 2022 15:14:30 -0600 Subject: [PATCH 244/357] use a more standard method of forward-declaring the structure --- ports/espressif/common-hal/socketpool/Socket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/socketpool/Socket.h b/ports/espressif/common-hal/socketpool/Socket.h index b189889cfd..6930db625e 100644 --- a/ports/espressif/common-hal/socketpool/Socket.h +++ b/ports/espressif/common-hal/socketpool/Socket.h @@ -34,6 +34,8 @@ #include "components/esp-tls/esp_tls.h" +typedef struct ssl_sslsocket_obj ssl_sslsocket_obj_t; + typedef struct { mp_obj_base_t base; int num; @@ -42,7 +44,7 @@ typedef struct { int ipproto; bool connected; socketpool_socketpool_obj_t *pool; - struct ssl_sslsocket_obj *ssl_socket; + ssl_sslsocket_obj_t *ssl_socket; mp_uint_t timeout_ms; } socketpool_socket_obj_t; From 2326b49b24af673ca6c64a06e6f5b70a3c4811d8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 7 Dec 2022 15:14:54 -0600 Subject: [PATCH 245/357] switch this header to 'pragma once' since I'm touching it already --- ports/espressif/common-hal/socketpool/Socket.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/espressif/common-hal/socketpool/Socket.h b/ports/espressif/common-hal/socketpool/Socket.h index 6930db625e..45e36e58ca 100644 --- a/ports/espressif/common-hal/socketpool/Socket.h +++ b/ports/espressif/common-hal/socketpool/Socket.h @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H -#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H +#pragma once #include "py/obj.h" @@ -49,5 +48,3 @@ typedef struct { } socketpool_socket_obj_t; void socket_user_reset(void); - -#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H From 68d510cb2f1868e7e5cab35aa3dfd1dbd1f719d4 Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Wed, 7 Dec 2022 23:00:09 -0500 Subject: [PATCH 246/357] Update mpconfigboard.h Configure LED pin for STATUS display and to prevent ESP floating pins from constantly lighting led dimly. --- ports/espressif/boards/bpi_picow_s3/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/espressif/boards/bpi_picow_s3/mpconfigboard.h b/ports/espressif/boards/bpi_picow_s3/mpconfigboard.h index f7e7fde31b..a261ed17fa 100644 --- a/ports/espressif/boards/bpi_picow_s3/mpconfigboard.h +++ b/ports/espressif/boards/bpi_picow_s3/mpconfigboard.h @@ -31,6 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO48) +#define MICROPY_HW_LED_STATUS (&pin_GPIO46) + #define DEFAULT_UART_BUS_RX (&pin_GPIO44) #define DEFAULT_UART_BUS_TX (&pin_GPIO43) From 99b8564e8f66bfec191669ed7360b8991ec92c2f Mon Sep 17 00:00:00 2001 From: s-ol Date: Thu, 8 Dec 2022 14:30:09 +0100 Subject: [PATCH 247/357] Add VfsFat.readonly property for getting current state Previously the only other way of determining whether the Vfs has been mounted read-write or read-only appears to be to attempt a write operation and detect a possible OSError. It wasn't possible for the user code to keep track of the state of the state since the boot VM has to decide whether to (re)mount read-write or read-only, but can't (easily) pass this information on to the runtime VM. --- extmod/vfs_fat.c | 13 +++++++++++++ shared-bindings/storage/__init__.c | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index 2a00566317..0a9737e53a 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -429,6 +429,18 @@ STATIC mp_obj_t vfs_fat_utime(mp_obj_t vfs_in, mp_obj_t path_in, mp_obj_t times_ } STATIC MP_DEFINE_CONST_FUN_OBJ_3(fat_vfs_utime_obj, vfs_fat_utime); +STATIC mp_obj_t vfs_fat_getreadonly(mp_obj_t self_in) { + fs_user_mount_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(!filesystem_is_writable_by_python(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(fat_vfs_getreadonly_obj, vfs_fat_getreadonly); +STATIC const mp_obj_property_t fat_vfs_readonly_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&fat_vfs_getreadonly_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + #if MICROPY_FATFS_USE_LABEL STATIC mp_obj_t vfs_fat_getlabel(mp_obj_t self_in) { fs_user_mount_t *self = MP_OBJ_TO_PTR(self_in); @@ -481,6 +493,7 @@ STATIC const mp_rom_map_elem_t fat_vfs_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_mount), MP_ROM_PTR(&vfs_fat_mount_obj) }, { MP_ROM_QSTR(MP_QSTR_umount), MP_ROM_PTR(&fat_vfs_umount_obj) }, { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&fat_vfs_utime_obj) }, + { MP_ROM_QSTR(MP_QSTR_readonly), MP_ROM_PTR(&fat_vfs_readonly_obj) }, #if MICROPY_FATFS_USE_LABEL { MP_ROM_QSTR(MP_QSTR_label), MP_ROM_PTR(&fat_vfs_label_obj) }, #endif diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 838395efb3..ad8b847fd5 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -258,6 +258,10 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { //| this property can only be set when the device is writable by the //| microcontroller.""" //| ... +//| readonly: bool +//| """``True`` when the device is mounted as readonly by the microcontroller. +//| This property cannot be changed, use `storage.remount` instead.""" +//| ... //| //| def mkfs(self) -> None: //| """Format the block device, deleting any data that may have been there""" From ef2bfdb5db464eec9b947750cfa7eb9467adfa85 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 1 Dec 2022 16:43:08 -0600 Subject: [PATCH 248/357] dotenv becomes settings.toml --- devices/ble_hci/common-hal/_bleio/Adapter.c | 16 +- docs/environment.rst | 32 +- docs/workflows.md | 14 +- locale/circuitpython.pot | 18 + .../espressif/bindings/esp32_camera/Camera.c | 2 +- ports/espressif/bindings/espidf/__init__.c | 2 +- ports/espressif/common-hal/_bleio/Adapter.c | 34 +- ports/espressif/supervisor/port.c | 4 +- ports/nrf/common-hal/_bleio/Adapter.c | 15 +- .../unix/variants/coverage/mpconfigvariant.mk | 6 +- py/circuitpy_defns.mk | 6 +- py/circuitpy_mpconfig.mk | 6 +- .../{dotenv => _environ}/__init__.c | 39 +- .../{dotenv => _environ}/__init__.h | 10 +- shared-module/_environ/__init__.c | 402 ++++++++++++++++++ shared-module/{dotenv => _environ}/__init__.h | 25 +- shared-module/dotenv/__init__.c | 312 -------------- shared-module/os/__init__.c | 9 +- .../shared/web_workflow/static/directory.js | 2 +- .../shared/web_workflow/static/welcome.html | 2 +- supervisor/shared/web_workflow/web_workflow.c | 65 ++- tests/circuitpython/bad1.toml | 1 + tests/circuitpython/bad2.toml | 1 + tests/circuitpython/bad3.toml | 1 + tests/circuitpython/dotenv_test.env | 37 -- tests/circuitpython/dotenv_test.py | 31 -- tests/circuitpython/dotenv_test.py.exp | 35 -- tests/circuitpython/environ_test.py | 42 ++ tests/circuitpython/environ_test.py.exp | 17 + tests/circuitpython/good.toml | 14 + tests/unix/extra_coverage.py.exp | 8 +- 31 files changed, 642 insertions(+), 566 deletions(-) rename shared-bindings/{dotenv => _environ}/__init__.c (68%) rename shared-bindings/{dotenv => _environ}/__init__.h (81%) create mode 100644 shared-module/_environ/__init__.c rename shared-module/{dotenv => _environ}/__init__.h (66%) delete mode 100644 shared-module/dotenv/__init__.c create mode 100644 tests/circuitpython/bad1.toml create mode 100644 tests/circuitpython/bad2.toml create mode 100644 tests/circuitpython/bad3.toml delete mode 100644 tests/circuitpython/dotenv_test.env delete mode 100644 tests/circuitpython/dotenv_test.py delete mode 100644 tests/circuitpython/dotenv_test.py.exp create mode 100644 tests/circuitpython/environ_test.py create mode 100644 tests/circuitpython/environ_test.py.exp create mode 100644 tests/circuitpython/good.toml diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 8c7b8f67eb..018b65de12 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -49,8 +49,8 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" -#if CIRCUITPY_DOTENV -#include "shared-module/dotenv/__init__.h" +#if CIRCUITPY_ENVIRON +#include "shared-bindings/_environ/__init__.h" #endif #define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION)) @@ -284,15 +284,15 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0 STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) { mp_int_t name_len = 0; - #if CIRCUITPY_DOTENV - char ble_name[32]; - name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); - if (name_len > 0) { - self->name = mp_obj_new_str(ble_name, (size_t)name_len); + #if CIRCUITPY_ENVIRON + mp_obj_t name = common_hal__environ_get_key("CIRCUITPY_BLE_NAME"); + if (name != mp_const_none) { + mp_arg_validate_type_string(name, MP_QSTR_CIRCUITPY_BLE_NAME); + self->name = name; } #endif - if (name_len <= 0) { + if (!self->name) { name_len = sizeof(default_ble_name); bt_addr_t addr; hci_check_error(hci_read_bd_addr(&addr)); diff --git a/docs/environment.rst b/docs/environment.rst index 5766b54380..457e5c3f88 100644 --- a/docs/environment.rst +++ b/docs/environment.rst @@ -6,24 +6,36 @@ variables are commonly used to store "secrets" such as Wi-Fi passwords and API keys. This method *does not* make them secure. It only separates them from the code. -CircuitPython supports these by mimicking the `dotenv `_ -CPython library. Other languages such as Javascript, PHP and Ruby also have -dotenv libraries. +CircuitPython supports these by parsing a subset of the `toml `_ file format internally. -These libraries store environment variables in a ``.env`` file. Here is a simple -example: +Here is a simple example: .. code-block:: bash - KEY1='value1' + KEY1="value1" # Comment - KEY2='value2 - is multiple lines' + KEY2="value2\ncontains a newline" -CircuitPython uses the ``.env`` at the drive root (no folder) as the environment. + [SECTION] # Only values in the "root table" are parsed + SECTION_VALUE = ... # so this value cannot be seen by getenv + +CircuitPython uses the ``settings.toml`` at the drive root (no folder) as the environment. User code can access the values from the file using `os.getenv()`. It is recommended to save any values used repeatedly in a variable because `os.getenv()` -will parse the ``/.env`` on every access. +will parse the ``settings.toml`` file contents on every access. + +Details of the toml language subset +----------------------------------- + +* The content is required to be in UTF-8 encoding +* The supported data types are string and integer +* Only basic strings are supported, not triple-quoted strings +* Only integers supported by strtol. (no 0o, no 0b, no underscores 1_000, 011 + is 9, not 11) +* Only bare keys are supported +* Duplicate keys are not diagnosed. +* Comments are supported +* Only values from the "root table" can be retrieved CircuitPython behavior ---------------------- diff --git a/docs/workflows.md b/docs/workflows.md index 26f5179b51..29229bd00e 100644 --- a/docs/workflows.md +++ b/docs/workflows.md @@ -46,7 +46,7 @@ connection, the central device can discover two default services. One for file t CircuitPython specifically that includes serial characteristics. To change the default BLE advertising name without (or before) running user code, the desired name -can be put in the `/.env` file. The key is `CIRCUITPY_BLE_NAME`. It's limited to approximately +can be put in the `settings.toml` file. The key is `CIRCUITPY_BLE_NAME`. It's limited to approximately 30 characters depending on the port's settings and will be truncated if longer. ### File Transfer API @@ -69,21 +69,21 @@ Read-only characteristic that returns the UTF-8 encoded version string. ## Web -The web workflow is depends on adding Wi-Fi credentials into the `/.env` file. The keys are +The web workflow is depends on adding Wi-Fi credentials into the `settings.toml` file. The keys are `CIRCUITPY_WIFI_SSID` and `CIRCUITPY_WIFI_PASSWORD`. Once these are defined, CircuitPython will automatically connect to the network and start the webserver used for the workflow. The webserver is on port 80 unless overridden by `CIRCUITPY_WEB_API_PORT`. It also enables MDNS. -Here is an example `/.env`: +Here is an example `/settings.toml`: ```bash # To auto-connect to Wi-Fi -CIRCUITPY_WIFI_SSID='scottswifi' -CIRCUITPY_WIFI_PASSWORD='secretpassword' +CIRCUITPY_WIFI_SSID="scottswifi" +CIRCUITPY_WIFI_PASSWORD="secretpassword" # To enable modifying files from the web. Change this too! # Leave the User field blank in the browser. -CIRCUITPY_WEB_API_PASSWORD='passw0rd' +CIRCUITPY_WEB_API_PASSWORD="passw0rd" CIRCUITPY_WEB_API_PORT=80 ``` @@ -124,7 +124,7 @@ All file system related APIs are protected by HTTP basic authentication. It is * hopefully prevent some griefing in shared settings. The password is sent unencrypted so do not reuse a password with something important. The user field is left blank. -The password is taken from `/.env` with the key `CIRCUITPY_WEB_API_PASSWORD`. If this is unset, the +The password is taken from `settings.toml` with the key `CIRCUITPY_WEB_API_PASSWORD`. If this is unset, the server will respond with `403 Forbidden`. When a password is set, but not provided in a request, it will respond `401 Unauthorized`. diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 450b2eabd7..16a682cfdd 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1002,6 +1002,10 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/dotenv/__init__.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1184,6 +1188,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/dotenv/__init__.c msgid "Internal error" msgstr "" @@ -1230,6 +1235,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" +#: shared-module/dotenv/__init__.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1260,10 +1270,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/dotenv/__init__.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" +#: shared-module/dotenv/__init__.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" diff --git a/ports/espressif/bindings/esp32_camera/Camera.c b/ports/espressif/bindings/esp32_camera/Camera.c index a770ea8ff7..9bcd398612 100644 --- a/ports/espressif/bindings/esp32_camera/Camera.c +++ b/ports/espressif/bindings/esp32_camera/Camera.c @@ -63,7 +63,7 @@ //| """ //| Configure and initialize a camera with the given properties //| -//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``/.env`` be large enough to hold the camera frambuffer(s). Generally, boards with built-in cameras will have a default setting that is large enough. If the constructor raises a MemoryError or an IDFError, this probably indicates the setting is too small and should be increased. +//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``settings.toml`` be large enough to hold the camera frambuffer(s). Generally, boards with built-in cameras will have a default setting that is large enough. If the constructor raises a MemoryError or an IDFError, this probably indicates the setting is too small and should be increased. //| //| //| .. important:: diff --git a/ports/espressif/bindings/espidf/__init__.c b/ports/espressif/bindings/espidf/__init__.c index c42a9e549d..12781000ae 100644 --- a/ports/espressif/bindings/espidf/__init__.c +++ b/ports/espressif/bindings/espidf/__init__.c @@ -132,7 +132,7 @@ STATIC mp_obj_t espidf_get_total_psram(void) { MP_DEFINE_CONST_FUN_OBJ_0(espidf_get_total_psram_obj, espidf_get_total_psram); //| def get_reserved_psram() -> int: -//| """Returns number of bytes of psram reserved for use by esp-idf, either a board-specific default value or the value defined in ``/.env``.""" +//| """Returns number of bytes of psram reserved for use by esp-idf, either a board-specific default value or the value defined in ``settings.toml``.""" //| STATIC mp_obj_t espidf_get_reserved_psram(void) { return MP_OBJ_NEW_SMALL_INT(common_hal_espidf_get_reserved_psram()); diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index 5eaf6e9cf4..121beb8e90 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -59,8 +59,8 @@ #include "esp_bt.h" #include "esp_nimble_hci.h" -#if CIRCUITPY_DOTENV -#include "shared-module/dotenv/__init__.h" +#if CIRCUITPY_ENVIRON +#include "shared-module/_environ/__init__.h" #endif bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; @@ -101,28 +101,24 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable ble_hs_cfg.sync_cb = _on_sync; // ble_hs_cfg.store_status_cb = ble_store_util_status_rr; - #if CIRCUITPY_DOTENV - mp_int_t name_len = 0; - char ble_name[32]; - name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); - if (name_len > 0) { - if (name_len > MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH) { - name_len = MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH; - } - ble_name[name_len] = '\0'; + #if CIRCUITPY_ENVIRON + char ble_name[1 + MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH]; + _environ_err_t result = _environ_get_key_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name)); + if (result == ENVIRON_OK) { ble_svc_gap_device_name_set(ble_name); - } else { + } else + #else + { ble_svc_gap_device_name_set("CIRCUITPY"); } - #else - ble_svc_gap_device_name_set("CIRCUITPY"); #endif - // Clear all of the internal connection objects. - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - bleio_connection_internal_t *connection = &bleio_connections[i]; - // Reset connection. - connection->conn_handle = BLEIO_HANDLE_INVALID; + {// Clear all of the internal connection objects. + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connection_internal_t *connection = &bleio_connections[i]; + // Reset connection. + connection->conn_handle = BLEIO_HANDLE_INVALID; + } } cp_task = xTaskGetCurrentTaskHandle(); diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 3106f4b991..e89fb8c976 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -55,7 +55,7 @@ #include "shared-bindings/microcontroller/RunMode.h" #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/socketpool/__init__.h" -#include "shared-module/dotenv/__init__.h" +#include "shared-module/_environ/__init__.h" #include "peripherals/rmt.h" #include "peripherals/timer.h" @@ -519,7 +519,7 @@ void port_idle_until_interrupt(void) { void port_post_boot_py(bool heap_valid) { if (!heap_valid && filesystem_present()) { mp_int_t reserved; - if (dotenv_get_key_int("/.env", "CIRCUITPY_RESERVED_PSRAM", &reserved)) { + if (_environ_get_key_int("CIRCUITPY_RESERVED_PSRAM", &reserved) == ENVIRON_OK) { common_hal_espidf_set_reserved_psram(reserved); } common_hal_espidf_reserve_psram(); diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 49b5d638f3..012430704a 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -52,8 +52,8 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" -#if CIRCUITPY_DOTENV -#include "shared-module/dotenv/__init__.h" +#if CIRCUITPY_ENVIRON +#include "shared-bindings/_environ/__init__.h" #endif #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) @@ -345,12 +345,11 @@ STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { mp_int_t name_len = 0; - #if CIRCUITPY_DOTENV - char ble_name[32]; - name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); - if (name_len > 0) { - ble_name[name_len] = '\0'; - common_hal_bleio_adapter_set_name(self, (char *)ble_name); + #if CIRCUITPY_ENVIRON + mp_obj_t ble_name = common_hal__environ_get_key("CIRCUITPY_BLE_NAME"); + if (ble_name != mp_const_none) { + common_hal_bleio_adapter_set_name(self, mp_obj_str_get_str(ble_name)); + return; } #endif diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index 1e8e59f9a9..a0e0f4f3bb 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -33,7 +33,7 @@ SRC_BITMAP := \ shared-bindings/aesio/__init__.c \ shared-bindings/bitmaptools/__init__.c \ shared-bindings/displayio/Bitmap.c \ - shared-bindings/dotenv/__init__.c \ + shared-bindings/_environ/__init__.c \ shared-bindings/rainbowio/__init__.c \ shared-bindings/traceback/__init__.c \ shared-bindings/util.c \ @@ -45,7 +45,7 @@ SRC_BITMAP := \ shared-module/displayio/Bitmap.c \ shared-module/displayio/ColorConverter.c \ shared-module/displayio/ColorConverter.c \ - shared-module/dotenv/__init__.c \ + shared-module/_environ/__init__.c \ shared-module/rainbowio/__init__.c \ shared-module/traceback/__init__.c \ shared-module/zlib/__init__.c \ @@ -56,7 +56,7 @@ CFLAGS += \ -DCIRCUITPY_AESIO=1 \ -DCIRCUITPY_BITMAPTOOLS=1 \ -DCIRCUITPY_DISPLAYIO_UNIX=1 \ - -DCIRCUITPY_DOTENV=1 \ + -DCIRCUITPY_ENVIRON=1 \ -DCIRCUITPY_GIFIO=1 \ -DCIRCUITPY_RAINBOWIO=1 \ -DCIRCUITPY_TRACEBACK=1 \ diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 70310106f0..7d8fa6bada 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -182,8 +182,8 @@ endif ifeq ($(CIRCUITPY_DISPLAYIO),1) SRC_PATTERNS += displayio/% endif -ifeq ($(CIRCUITPY_DOTENV),1) -SRC_PATTERNS += dotenv/% +ifeq ($(CIRCUITPY_ENVIRON),1) +SRC_PATTERNS += _environ/% endif ifeq ($(CIRCUITPY__EVE),1) SRC_PATTERNS += _eve/% @@ -589,7 +589,7 @@ SRC_SHARED_MODULE_ALL = \ displayio/TileGrid.c \ displayio/area.c \ displayio/__init__.c \ - dotenv/__init__.c \ + _environ/__init__.c \ floppyio/__init__.c \ fontio/BuiltinFont.c \ fontio/__init__.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 3ca23263d4..a6a1118d2d 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -208,9 +208,6 @@ CFLAGS += -DCIRCUITPY_BITMAPTOOLS=$(CIRCUITPY_BITMAPTOOLS) CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_VECTORIO=$(CIRCUITPY_VECTORIO) -CIRCUITPY_DOTENV ?= $(CIRCUITPY_FULL_BUILD) -CFLAGS += -DCIRCUITPY_DOTENV=$(CIRCUITPY_DOTENV) - CIRCUITPY_DUALBANK ?= 0 CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) @@ -218,6 +215,9 @@ CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) +CIRCUITPY_ENVIRON ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_ENVIRON=$(CIRCUITPY_ENVIRON) + CIRCUITPY_ERRNO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO) diff --git a/shared-bindings/dotenv/__init__.c b/shared-bindings/_environ/__init__.c similarity index 68% rename from shared-bindings/dotenv/__init__.c rename to shared-bindings/_environ/__init__.c index 193338c7c2..81d778f3ed 100644 --- a/shared-bindings/dotenv/__init__.c +++ b/shared-bindings/_environ/__init__.c @@ -33,11 +33,11 @@ #include "py/obj.h" #include "py/objstr.h" #include "py/runtime.h" -#include "shared-bindings/dotenv/__init__.h" +#include "shared-bindings/_environ/__init__.h" //| """Functions to manage environment variables from a .env file. //| -//| A subset of the CPython `dotenv library `_. It does +//| A subset of the CPython `_environ library `_. It does //| not support variables or double quotes. //| //| Keys and values may be put in single quotes. @@ -71,43 +71,30 @@ //| import typing //| -//| def get_key(dotenv_path: str, key_to_get: str) -> Optional[str]: +//| def get_key(_environ_path: str, key_to_get: str) -> Optional[str]: //| """Get the value for the given key from the given .env file. If the key occurs multiple //| times in the file, then the last value will be returned. //| //| Returns None if the key isn't found or doesn't have a value.""" //| ... //| -STATIC mp_obj_t _dotenv_get_key(mp_obj_t path_in, mp_obj_t key_to_get_in) { - return common_hal_dotenv_get_key(mp_obj_str_get_str(path_in), +STATIC mp_obj_t __environ_get_key(mp_obj_t path_in, mp_obj_t key_to_get_in) { + return common_hal__environ_get_key_path(mp_obj_str_get_str(path_in), mp_obj_str_get_str(key_to_get_in)); } -MP_DEFINE_CONST_FUN_OBJ_2(dotenv_get_key_obj, _dotenv_get_key); +MP_DEFINE_CONST_FUN_OBJ_2(_environ_get_key_obj, __environ_get_key); -//| def load_dotenv() -> None: -//| """Does nothing in CircuitPython because os.getenv will automatically read .env when -//| available. -//| -//| Present in CircuitPython so CPython-compatible code can use it without error.""" -//| ... -//| -STATIC mp_obj_t dotenv_load_dotenv(void) { - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_0(dotenv_load_dotenv_obj, dotenv_load_dotenv); +STATIC const mp_rom_map_elem_t _environ_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__environ) }, -STATIC const mp_rom_map_elem_t dotenv_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_dotenv) }, - - { MP_ROM_QSTR(MP_QSTR_get_key), MP_ROM_PTR(&dotenv_get_key_obj) }, - { MP_ROM_QSTR(MP_QSTR_load_dotenv), MP_ROM_PTR(&dotenv_load_dotenv_obj) }, + { MP_ROM_QSTR(MP_QSTR_get_key), MP_ROM_PTR(&_environ_get_key_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(dotenv_module_globals, dotenv_module_globals_table); +STATIC MP_DEFINE_CONST_DICT(_environ_module_globals, _environ_module_globals_table); -const mp_obj_module_t dotenv_module = { +const mp_obj_module_t _environ_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&dotenv_module_globals, + .globals = (mp_obj_dict_t *)&_environ_module_globals, }; -MP_REGISTER_MODULE(MP_QSTR_dotenv, dotenv_module, CIRCUITPY_DOTENV); +MP_REGISTER_MODULE(MP_QSTR__environ, _environ_module, CIRCUITPY_ENVIRON); diff --git a/shared-bindings/dotenv/__init__.h b/shared-bindings/_environ/__init__.h similarity index 81% rename from shared-bindings/dotenv/__init__.h rename to shared-bindings/_environ/__init__.h index 18a6c280dd..7779f3ac82 100644 --- a/shared-bindings/dotenv/__init__.h +++ b/shared-bindings/_environ/__init__.h @@ -24,16 +24,14 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H +#pragma once #include #include #include "py/objtuple.h" -#include "shared-module/dotenv/__init__.h" +#include "shared-module/_environ/__init__.h" -mp_obj_t common_hal_dotenv_get_key(const char *path, const char *key); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H +mp_obj_t common_hal__environ_get_key_path(const char *path, const char *key); +mp_obj_t common_hal__environ_get_key(const char *key); diff --git a/shared-module/_environ/__init__.c b/shared-module/_environ/__init__.c new file mode 100644 index 0000000000..7e6e133e1a --- /dev/null +++ b/shared-module/_environ/__init__.c @@ -0,0 +1,402 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 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 +#include + +#include "shared-bindings/_environ/__init__.h" + +#include "py/gc.h" +#include "py/misc.h" +#include "py/mpstate.h" +#include "py/objstr.h" +#include "py/parsenum.h" +#include "py/runtime.h" +#include "supervisor/filesystem.h" +#include "supervisor/memory.h" + +#define ENVIRON_PATH "settings.toml" + +#if defined(UNIX) +typedef FILE *file_arg; +STATIC bool open_file(const char *name, file_arg *active_file) { + FILE *result = fopen(name, "r"); + if (result) { + *active_file = result; + } + return result != NULL; +} +STATIC void close_file(file_arg *active_file) { + fclose(*active_file); +} +STATIC bool is_eof(file_arg *active_file) { + return feof(*active_file); +} +STATIC uint8_t get_next_byte(file_arg *active_file) { + int value = fgetc(*active_file); + if (value == EOF) { + return 0; + } + return value; +} +__attribute__((unused)) +STATIC void seek_eof(file_arg *active_file) { + fseek(*active_file, 0, SEEK_END); + (void)fgetc(*active_file); +} +#else +#include "extmod/vfs.h" +#include "extmod/vfs_fat.h" +typedef FIL file_arg; +STATIC bool open_file(const char *name, file_arg *active_file) { + FATFS *fs = filesystem_circuitpy(); + FRESULT result = f_open(fs, active_file, name, FA_READ); + return result == FR_OK; +} +STATIC void close_file(file_arg *active_file) { + // nothing +} +STATIC bool is_eof(file_arg *active_file) { + return f_eof(active_file); +} + +// Return 0 if there is no next character (EOF). +STATIC uint8_t get_next_byte(FIL *active_file) { + uint8_t character = 0; + UINT quantity_read; + // If there's an error or quantity_read is 0, character will remain 0. + f_read(active_file, &character, 1, &quantity_read); + return character; +} +STATIC void seek_eof(file_arg *active_file) { + f_lseek(active_file, f_size(active_file)); +} +#endif + +// For a fixed buffer, record the required size rather than throwing +STATIC void vstr_add_byte_nonstd(vstr_t *vstr, byte b) { + if (!vstr->fixed_buf || vstr->alloc > vstr->len) { + vstr_add_byte(vstr, b); + } else { + vstr->len++; + } +} + +// For a fixed buffer, record the required size rather than throwing +STATIC void vstr_add_char_nonstd(vstr_t *vstr, unichar c) { + size_t ulen = + (c < 0x80) ? 1 : + (c < 0x800) ? 2 : + (c < 0x10000) ? 3 : 4; + if (!vstr->fixed_buf || vstr->alloc > vstr->len + ulen) { + vstr_add_char(vstr, c); + } else { + vstr->len += ulen; + } +} + +STATIC void next_line(file_arg *active_file) { + uint8_t character; + do { + character = get_next_byte(active_file); + } while (character != 0 && character != '\n'); +} + +// Discard whitespace, except for newlines, returning the next character after the whitespace. +// Return 0 if there is no next character (EOF). +STATIC uint8_t consume_whitespace(file_arg *active_file) { + uint8_t character; + do { + character = get_next_byte(active_file); + } while (character != '\n' && character != 0 && unichar_isspace(character)); + return character; +} + +// Starting at the start of a new line, determines if the key matches the given +// key. +// +// If result is true, the key matches and file pointer is pointing just after the "=". +// If the result is false, the key does NOT match and the file pointer is +// pointing at the start of the next line, if any +STATIC bool key_matches(file_arg *active_file, const char *key) { + uint8_t character; + character = consume_whitespace(active_file); + if (character == '[' || character == 0) { + seek_eof(active_file); + return false; + } + while (*key) { + if (character != *key++) { + // A character didn't match the key, so it's not a match + // If the non-matching char was not the end of the line, + // then consume the rest of the line + if (character != '\n') { + next_line(active_file); + } + return false; + } + character = get_next_byte(active_file); + } + // the next character could be whitespace; consume if necessary + if (unichar_isspace(character)) { + character = consume_whitespace(active_file); + } + // If we're not looking at the "=" then the key didn't match + if (character != '=') { + // A character didn't match the key, so it's not a match + // If the non-matching char was not the end of the line, + // then consume the rest of the line + if (character != '\n') { + next_line(active_file); + } + return false; + } + return true; +} + +STATIC _environ_err_t read_unicode_escape(file_arg *active_file, int sz, vstr_t *buf) { + char hex_buf[sz + 1]; + for (int i = 0; i < sz; i++) { + hex_buf[i] = get_next_byte(active_file); + } + hex_buf[sz] = 0; + char *end; + unsigned long c = strtoul(hex_buf, &end, 16); + if (end != &hex_buf[sz]) { + return ENVIRON_ERR_UNEXPECTED | *end; + } + if (c >= 0x110000) { + return ENVIRON_ERR_UNICODE; + } + vstr_add_char_nonstd(buf, c); + return ENVIRON_OK; +} + +// Read a quoted string +STATIC _environ_err_t read_string_value(file_arg *active_file, vstr_t *buf) { + while (true) { + int character = get_next_byte(active_file); + switch (character) { + case 0: + case '\n': + return ENVIRON_ERR_UNEXPECTED | character; + + case '"': + character = consume_whitespace(active_file); + switch (character) { + case '#': + next_line(active_file); + MP_FALLTHROUGH; + case '\n': + return ENVIRON_OK; + default: + return ENVIRON_ERR_UNEXPECTED | character; + } + + case '\\': + character = get_next_byte(active_file); + switch (character) { + case 0: + case '\n': + return ENVIRON_ERR_UNEXPECTED | character; + case 'b': + character = '\b'; + break; + case 'r': + character = '\r'; + break; + case 'n': + character = '\n'; + break; + case 't': + character = '\t'; + break; + case 'v': + character = '\v'; + break; + case 'f': + character = '\f'; + break; + case 'U': + case 'u': { + int sz = (character == 'u') ? 4 : 8; + _environ_err_t res; + res = read_unicode_escape(active_file, sz, buf); + if (res != ENVIRON_OK) { + return res; + } + continue; + } + // default falls through, other escaped characters + // represent themselves + } + MP_FALLTHROUGH; + default: + vstr_add_byte_nonstd(buf, character); + } + } +} + +// Read a numeric value (non-quoted value) as a string +STATIC _environ_err_t read_bare_value(file_arg *active_file, vstr_t *buf, int first_character) { + int character = first_character; + while (true) { + switch (character) { + case 0: + return ENVIRON_ERR_UNEXPECTED | character; + case '\n': + return ENVIRON_OK; + case '#': + next_line(active_file); + return ENVIRON_OK; + default: + vstr_add_byte_nonstd(buf, character); + } + character = get_next_byte(active_file); + } +} + +STATIC mp_int_t read_value(file_arg *active_file, vstr_t *buf, bool *quoted) { + uint8_t character; + character = consume_whitespace(active_file); + *quoted = (character == '"'); + + if (*quoted) { + return read_string_value(active_file, buf); + } else { + return read_bare_value(active_file, buf, character); + } +} + +STATIC _environ_err_t _environ_get_key_vstr(const char *path, const char *key, vstr_t *buf, bool *quoted) { + file_arg active_file; + if (!open_file(path, &active_file)) { + return ENVIRON_ERR_OPEN; + } + + _environ_err_t result = ENVIRON_ERR_NOT_FOUND; + while (!is_eof(&active_file)) { + if (key_matches(&active_file, key)) { + result = read_value(&active_file, buf, quoted); + } + } + close_file(&active_file); + return result; +} + +STATIC _environ_err_t _environ_get_key_buf_terminated(const char *key, char *value, size_t value_len, bool *quoted) { + vstr_t buf; + vstr_init_fixed_buf(&buf, value_len, value); + _environ_err_t result = _environ_get_key_vstr(ENVIRON_PATH, key, &buf, quoted); + + if (result == ENVIRON_OK) { + vstr_add_byte_nonstd(&buf, 0); + memcpy(value, buf.buf, MIN(buf.len, value_len)); + if (buf.len > value_len) { + result = ENVIRON_ERR_LENGTH; + } + } + return result; +} + +_environ_err_t _environ_get_key_str(const char *key, char *value, size_t value_len) { + bool quoted; + _environ_err_t result = _environ_get_key_buf_terminated(key, value, value_len, "ed); + if (result == ENVIRON_OK && !quoted) { + result = ENVIRON_ERR_UNEXPECTED | value[0]; + } + return result; +} + +STATIC void throw__environ_error(_environ_err_t error) { + if (error == ENVIRON_OK) { + return; + } + if (error & ENVIRON_ERR_UNEXPECTED) { + byte character = (error & 0xff); + mp_print_t print; + vstr_t vstr; + vstr_init_print(&vstr, 8 + 4 + 1, &print); + if (character) { + mp_str_print_quoted(&print, &character, 1, true); + } else { + mp_str_print_quoted(&print, (byte *)"EOF", 3, true); + } + mp_raise_ValueError_varg(translate("Invalid byte %.*s"), + vstr.len, vstr.buf); + } + switch (error) { + case ENVIRON_ERR_OPEN: + mp_raise_ValueError(translate("File not found")); + case ENVIRON_ERR_UNICODE: + mp_raise_ValueError(translate("Invalid unicode escape")); + case ENVIRON_ERR_NOT_FOUND: + mp_raise_ValueError(translate("Key not found")); + default: + mp_raise_RuntimeError(translate("Internal error")); + } +} + +mp_obj_t common_hal__environ_get_key_path(const char *path, const char *key) { + vstr_t buf; + bool quoted; + + vstr_init(&buf, 64); + _environ_err_t result = _environ_get_key_vstr(path, key, &buf, "ed); + if (result == ENVIRON_ERR_NOT_FOUND) { + return mp_const_none; + } + throw__environ_error(result); + + if (quoted) { + return mp_obj_new_str_from_vstr(&mp_type_str, &buf); + } else { + return mp_parse_num_integer(buf.buf, buf.len, 0, NULL); + } +} + +mp_obj_t common_hal__environ_get_key(const char *key) { + return common_hal__environ_get_key_path(ENVIRON_PATH, key); +} + +_environ_err_t _environ_get_key_int(const char *key, mp_int_t *value) { + char buf[16]; + bool quoted; + _environ_err_t result = _environ_get_key_buf_terminated(key, buf, sizeof(buf), "ed); + if (result != ENVIRON_OK) { + return result; + } + if (quoted) { + return ENVIRON_ERR_UNEXPECTED | '"'; + } + char *end; + long num = strtol(buf, &end, 0); + if (end == buf || *end) { // If the whole buffer was not consumed it's an error + return ENVIRON_ERR_UNEXPECTED | *end; + } + *value = (mp_int_t)num; + return ENVIRON_OK; +} diff --git a/shared-module/dotenv/__init__.h b/shared-module/_environ/__init__.h similarity index 66% rename from shared-module/dotenv/__init__.h rename to shared-module/_environ/__init__.h index fb27233692..c96eb028b8 100644 --- a/shared-module/dotenv/__init__.h +++ b/shared-module/_environ/__init__.h @@ -24,13 +24,22 @@ * THE SOFTWARE. */ +#pragma once + +typedef enum { + ENVIRON_OK = 0, + ENVIRON_ERR_OPEN, + ENVIRON_ERR_UNICODE, + ENVIRON_ERR_LENGTH, + ENVIRON_ERR_NOT_FOUND, + ENVIRON_ERR_UNEXPECTED = 0xff00, // logical or'd with the byte value +} _environ_err_t; + // Allocation free version that returns the full length of the value. -mp_int_t dotenv_get_key(const char *path, const char *key, char *value, mp_int_t value_len); +// If it fits, the return value is 0-terminated. If the value doesn't fit, +// *value_len may be an over-estimate but never an under-estimate. +_environ_err_t _environ_get_key_str(const char *key, char *value, size_t value_len); -// Returns true and sets value to a '\0'-terminated string if key is present -// and the value (including the terminating '\0') fits strictly within -// value_len bytes. -bool dotenv_get_key_terminated(const char *path, const char *key, char *value, mp_int_t value_len); - -// Returns true and sets value to the read value. Returns false if the value was not numeric. -bool dotenv_get_key_int(const char *path, const char *key, mp_int_t *value); +// Returns ENVIRON_ERR_OK and sets value to the read value. Returns +// ENVIRON_ERR_... if the value was not numeric. allocation-free. +_environ_err_t _environ_get_key_int(const char *key, mp_int_t *value); diff --git a/shared-module/dotenv/__init__.c b/shared-module/dotenv/__init__.c deleted file mode 100644 index ead7c6561b..0000000000 --- a/shared-module/dotenv/__init__.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2022 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 -#include - -#include "shared-bindings/dotenv/__init__.h" - -#include "py/misc.h" -#include "py/mpstate.h" -#include "py/objstr.h" -#include "supervisor/filesystem.h" - -#if defined(UNIX) -typedef FILE *file_arg; -STATIC bool open_file(const char *name, file_arg *active_file) { - FILE *result = fopen(name, "r"); - if (result) { - *active_file = result; - } - return result != NULL; -} -STATIC void close_file(file_arg *active_file) { - fclose(*active_file); -} -STATIC uint8_t get_next_character(file_arg *active_file) { - int value = fgetc(*active_file); - if (value == EOF) { - return 0; - } - return value; -} -STATIC void seek_minus_one(file_arg *active_file) { - fseek(*active_file, -1, SEEK_CUR); -} -#else -#include "extmod/vfs.h" -#include "extmod/vfs_fat.h" -typedef FIL file_arg; -STATIC bool open_file(const char *name, file_arg *active_file) { - FATFS *fs = filesystem_circuitpy(); - FRESULT result = f_open(fs, active_file, name, FA_READ); - return result == FR_OK; -} -STATIC void close_file(file_arg *active_file) { - // nothing -} - -// Return 0 if there is no next character (EOF). -STATIC uint8_t get_next_character(FIL *active_file) { - uint8_t character = 0; - UINT quantity_read; - // If there's an error or quantity_read is 0, character will remain 0. - f_read(active_file, &character, 1, &quantity_read); - return character; -} -STATIC void seek_minus_one(file_arg *active_file) { - f_lseek(active_file, f_tell(active_file) - 1); -} -#endif - -// Discard whitespace, except for newlines, returning the next character after the whitespace. -// Return 0 if there is no next character (EOF). -STATIC uint8_t consume_whitespace(file_arg *active_file) { - uint8_t character; - do { - character = get_next_character(active_file); - } while (character != '\n' && character != 0 && unichar_isspace(character)); - return character; -} - -// Starting at the start of a new line, determines if the key matches the given -// key. File pointer is set to be just before the = after the key. -STATIC bool key_matches(file_arg *active_file, const char *key) { - uint8_t character; - character = consume_whitespace(active_file); - if (character == 0) { - return false; - } - bool quoted = false; - if (character == '\'') { - // Beginning of single-quoted string. - quoted = true; - character = get_next_character(active_file); - } - size_t key_pos = 0; - bool escaped = false; - bool matches = true; - size_t key_len = strlen(key); - while (character != 0) { - if (character == '\\' && !escaped && quoted) { - escaped = true; - } else if (!escaped && quoted && character == '\'') { - quoted = false; - // End of quoted key. Skip over the ending quote. - character = get_next_character(active_file); - break; - } else if (!quoted && (unichar_isspace(character) || character == '=' || character == '\n' || character == '#' || character == 0)) { - // End of unquoted key. - break; - } else { - // Still on tentative key; see if it matches the next supplied key character, - // but don't run off the end of the supplied key. - if (key_pos < key_len) { - matches = matches && (unsigned char)key[key_pos] == character; - escaped = false; - key_pos++; - } else { - // Key on line is too long. - matches = false; - } - } - character = get_next_character(active_file); - } - if (character == '=' || character == '\n' || character == '#' || character == 0) { - // Rewind one so the value, if any, can be found. - seek_minus_one(active_file); - } else if (!unichar_isspace(character)) { - // We're followed by something else that is invalid syntax. - matches = false; - } - - return matches && key_pos == key_len; -} - -STATIC bool next_line(file_arg *active_file) { - uint8_t character; - bool quoted = false; - bool escaped = false; - // Track comments because they last until the end of the line. - bool comment = false; - // Consume all characters while quoted or others up to \n. - do { - character = get_next_character(active_file); - - if ((!quoted || character == '#') || comment) { - // Comments consume any escaping. - comment = true; - } else if (!escaped) { - if (character == '\'') { - quoted = !quoted; - } else if (character == '\\') { - escaped = true; - } - } else { - escaped = false; - } - } while (character != 0 && (quoted || character != '\n')); - - return character != 0; -} - -STATIC mp_int_t read_value(file_arg *active_file, char *value, size_t value_len) { - uint8_t character; - // Consume spaces before "=", and get first character of interest. - character = consume_whitespace(active_file); - if (character != '=') { - if (character == '#' || character == '\n') { - // Keys without an = after them are valid with the value None. - return -1; - } - // All other characters are invalid. - return -1; - } - // Consume space after = - if (character != '#') { - // a # immediately after = is part of the value! - character = consume_whitespace(active_file); - } - bool quoted = false; - if (character == '\'') { - quoted = true; - character = get_next_character(active_file); - } - if (character == '"') { - // We don't support double quoted values. - return -1; - } - // Copy the value over. - size_t value_pos = 0; - bool escaped = false; - // Count trailing spaces so we can ignore them at the end of unquoted - // values. - size_t trailing_spaces = 0; - bool first_char = true; - while (character != 0) { - // Consume the first \ if the value is quoted. - if (quoted && character == '\\' && !escaped) { - escaped = true; - // Drop this backslash by short circuiting the rest of the loop. - character = get_next_character(active_file); - continue; - } - if (quoted && !escaped && character == '\'') { - // trailing ' means the value is done. - break; - } - // Unquoted values are ended by a newline or comment. - if (!quoted && (character == '\n' || (character == '#' && !first_char))) { - if (character == '\n') { - // Rewind one so the next_line can find the \n. - seek_minus_one(active_file); - } - break; - } - if (!quoted && unichar_isspace(character)) { - trailing_spaces += 1; - } else { - trailing_spaces = 0; - } - escaped = false; - // Only copy the value over if we have space. Otherwise, we'll just - // count the overall length. - if (value_pos < value_len) { - value[value_pos] = character; - } - value_pos++; - character = get_next_character(active_file); - first_char = false; - } - - return value_pos - trailing_spaces; -} - -mp_int_t dotenv_get_key(const char *path, const char *key, char *value, mp_int_t value_len) { - file_arg active_file; - if (!open_file(path, &active_file)) { - return -1; - } - - mp_int_t actual_value_len = -1; - bool read_ok = true; - while (read_ok) { - if (key_matches(&active_file, key)) { - actual_value_len = read_value(&active_file, value, value_len); - } - - read_ok = next_line(&active_file); - } - close_file(&active_file); - return actual_value_len; -} - -mp_obj_t common_hal_dotenv_get_key(const char *path, const char *key) { - // Use the stack for short values. Longer values will require a heap allocation after we know - // the length. - char value[64]; - mp_int_t actual_len = dotenv_get_key(path, key, value, sizeof(value)); - if (actual_len < 0) { - return mp_const_none; - } - if ((size_t)actual_len >= sizeof(value)) { - byte *buf = m_new(byte, actual_len + 1); - dotenv_get_key(path, key, (char *)buf, actual_len); - buf[actual_len] = 0; - - mp_obj_str_t *o = m_new_obj(mp_obj_str_t); - o->base.type = &mp_type_str; - o->len = actual_len; - o->data = buf; - o->hash = qstr_compute_hash(buf, actual_len); - - return MP_OBJ_FROM_PTR(o); - } - return mp_obj_new_str(value, actual_len); -} - -bool dotenv_get_key_terminated(const char *path, const char *key, char *value, mp_int_t value_len) { - mp_int_t actual_len = dotenv_get_key(path, key, value, value_len - 1); - if (actual_len >= value_len) { - return false; - } - value[actual_len] = '\0'; // terminate string - return true; -} - -bool dotenv_get_key_int(const char *path, const char *key, mp_int_t *value) { - char buf[16]; - if (!dotenv_get_key_terminated(path, key, buf, (mp_int_t)sizeof(buf))) { - return false; - } - char *end; - long result = strtol(buf, &end, 0); - if (end == buf || *end) { // If the whole buffer was not consumed it's an error - return false; - } - *value = (mp_int_t)result; - return true; -} diff --git a/shared-module/os/__init__.c b/shared-module/os/__init__.c index 200fcb2f61..57e7e62932 100644 --- a/shared-module/os/__init__.c +++ b/shared-module/os/__init__.c @@ -36,8 +36,8 @@ #include "py/runtime.h" #include "shared-bindings/os/__init__.h" -#if CIRCUITPY_DOTENV -#include "shared-bindings/dotenv/__init__.h" +#if CIRCUITPY_ENVIRON +#include "shared-bindings/_environ/__init__.h" #endif // This provides all VFS related OS functions so that ports can share the code @@ -112,8 +112,9 @@ mp_obj_t common_hal_os_getcwd(void) { } mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_) { - #if CIRCUITPY_DOTENV - mp_obj_t env_obj = common_hal_dotenv_get_key("/.env", key); + #if CIRCUITPY_ENVIRON + mp_obj_t env_obj = common_hal__environ_get_key(key); + // TODO must be a str object if (env_obj != mp_const_none) { return env_obj; } diff --git a/supervisor/shared/web_workflow/static/directory.js b/supervisor/shared/web_workflow/static/directory.js index c1d934c1a8..a89d5e5602 100644 --- a/supervisor/shared/web_workflow/static/directory.js +++ b/supervisor/shared/web_workflow/static/directory.js @@ -95,7 +95,7 @@ async function refresh_list() { if (f.directory) { icon = "📁"; } else if(f.name.endsWith(".txt") || - f.name.endsWith(".env") || + f.name.endsWith(".toml") || f.name.endsWith(".py") || f.name.endsWith(".js") || f.name.endsWith(".json")) { diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html index e773bb6a2e..efbb30e312 100644 --- a/supervisor/shared/web_workflow/static/welcome.html +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -12,7 +12,7 @@

 Welcome!

-

Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Go to the full code editor for a more enriching experience which requires an active internet connection. Go to the serial terminal to see code output and interact with the REPL. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /.env. Provide the password when the browser prompts for it. Leave the username blank.

+

Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Go to the full code editor for a more enriching experience which requires an active internet connection. Go to the serial terminal to see code output and interact with the REPL. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /settings.toml. Provide the password when the browser prompts for it. Leave the username blank.

Device Info:

diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 231b1e8ffb..d54f853891 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -64,8 +64,8 @@ #include "shared-bindings/wifi/__init__.h" #endif -#if CIRCUITPY_DOTENV -#include "shared-module/dotenv/__init__.h" +#if CIRCUITPY_ENVIRON +#include "shared-module/_environ/__init__.h" #endif enum request_state { @@ -115,7 +115,7 @@ static wifi_radio_error_t _last_wifi_status = WIFI_RADIO_ERROR_NONE; static mdns_server_obj_t mdns; #endif -static uint32_t web_api_port = 80; +static mp_int_t web_api_port = 80; static socketpool_socketpool_obj_t pool; static socketpool_socket_obj_t listening; @@ -244,22 +244,23 @@ void supervisor_web_workflow_status(void) { #endif void supervisor_start_web_workflow(void) { - #if CIRCUITPY_WEB_WORKFLOW && CIRCUITPY_WIFI - + #if CIRCUITPY_WEB_WORKFLOW && CIRCUITPY_WIFI && CIRCUITPY_ENVIRON char ssid[33]; char password[64]; - mp_int_t ssid_len = 0; - mp_int_t password_len = 0; + size_t ssid_len = 0; + size_t password_len = 0; - #if CIRCUITPY_DOTENV - ssid_len = dotenv_get_key("/.env", "CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid) - 1); - password_len = dotenv_get_key("/.env", "CIRCUITPY_WIFI_PASSWORD", password, sizeof(password) - 1); - #endif - if (ssid_len <= 0 || (size_t)ssid_len >= sizeof(ssid) || - password_len <= 0 || (size_t)password_len >= sizeof(password)) { + _environ_err_t result = _environ_get_key_str("CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid)); + if (result != ENVIRON_OK) { return; } + + result = _environ_get_key_str("CIRCUITPY_WIFI_PASSWORD", password, sizeof(password)); + if (result != ENVIRON_OK) { + return; + } + if (!common_hal_wifi_radio_get_enabled(&common_hal_wifi_radio_obj)) { common_hal_wifi_init(false); common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, true); @@ -268,9 +269,6 @@ void supervisor_start_web_workflow(void) { // TODO: Do our own scan so that we can find the channel we want before calling connect. // Otherwise, connect will do a full slow scan to pick the best AP. - // NUL terminate the strings because dotenv doesn't. - ssid[ssid_len] = '\0'; - password[password_len] = '\0'; // We can all connect again because it will return early if we're already connected to the // network. If we are connected to a different network, then it will disconnect before // attempting to connect to the given network. @@ -283,21 +281,15 @@ void supervisor_start_web_workflow(void) { return; } - char port_encoded[6]; - size_t port_len = 0; - size_t new_port = web_api_port; - #if CIRCUITPY_DOTENV - port_len = dotenv_get_key("/.env", "CIRCUITPY_WEB_API_PORT", port_encoded, sizeof(port_encoded) - 1); - #endif - if (0 < port_len && port_len < sizeof(port_encoded)) { - port_encoded[port_len] = '\0'; - new_port = strtoul(port_encoded, NULL, 10); - } + mp_int_t new_port = web_api_port; + // (leaves new_port unchanged on any failure) + (void)_environ_get_key_int("CIRCUITPY_WEB_API_PORT", &new_port); bool first_start = pool.base.type != &socketpool_socketpool_type; bool port_changed = new_port != web_api_port; if (first_start) { + port_changed = false; #if CIRCUITPY_MDNS mdns_server_construct(&mdns, true); mdns.base.type = &mdns_server_type; @@ -326,11 +318,12 @@ void supervisor_start_web_workflow(void) { common_hal_socketpool_socket_listen(&listening, 1); } - mp_int_t api_password_len = dotenv_get_key("/.env", "CIRCUITPY_WEB_API_PASSWORD", _api_password + 1, sizeof(_api_password) - 2); - if (api_password_len > 0) { + + const size_t api_password_len = sizeof(_api_password) - 1; + result = _environ_get_key_str("CIRCUITPY_WEB_API_PASSWORD", _api_password + 1, api_password_len); + if (result == ENVIRON_OK) { _api_password[0] = ':'; - _api_password[api_password_len + 1] = '\0'; - _base64_in_place(_api_password, api_password_len + 1, sizeof(_api_password)); + _base64_in_place(_api_password, strlen(_api_password), sizeof(_api_password) - 1); } #endif } @@ -691,16 +684,16 @@ static void _reply_with_file(socketpool_socket_obj_t *socket, _request *request, mp_print_t _socket_print = {socket, _print_raw}; mp_printf(&_socket_print, "Content-Length: %d\r\n", total_length); // TODO: Make this a table to save space. - if (_endswith(filename, ".txt") || _endswith(filename, ".py")) { - _send_strs(socket, "Content-Type: text/plain", ";charset=UTF-8\r\n", NULL); + if (_endswith(filename, ".txt") || _endswith(filename, ".py") || _endswith(filename, ".toml")) { + _send_strs(socket, "Content-Type:", "text/plain", ";charset=UTF-8\r\n", NULL); } else if (_endswith(filename, ".js")) { - _send_strs(socket, "Content-Type: text/javascript", ";charset=UTF-8\r\n", NULL); + _send_strs(socket, "Content-Type:", "text/javascript", ";charset=UTF-8\r\n", NULL); } else if (_endswith(filename, ".html")) { - _send_strs(socket, "Content-Type: text/html", ";charset=UTF-8\r\n", NULL); + _send_strs(socket, "Content-Type:", "text/html", ";charset=UTF-8\r\n", NULL); } else if (_endswith(filename, ".json")) { - _send_strs(socket, "Content-Type: application/json", ";charset=UTF-8\r\n", NULL); + _send_strs(socket, "Content-Type:", "application/json", ";charset=UTF-8\r\n", NULL); } else { - _send_str(socket, "Content-Type: application/octet-stream\r\n"); + _send_strs(socket, "Content-Type:", "application/octet-stream\r\n"); } _cors_header(socket, request); _send_str(socket, "\r\n"); diff --git a/tests/circuitpython/bad1.toml b/tests/circuitpython/bad1.toml new file mode 100644 index 0000000000..fce8db1800 --- /dev/null +++ b/tests/circuitpython/bad1.toml @@ -0,0 +1 @@ +string = " diff --git a/tests/circuitpython/bad2.toml b/tests/circuitpython/bad2.toml new file mode 100644 index 0000000000..666c573716 --- /dev/null +++ b/tests/circuitpython/bad2.toml @@ -0,0 +1 @@ +string = """ diff --git a/tests/circuitpython/bad3.toml b/tests/circuitpython/bad3.toml new file mode 100644 index 0000000000..705443a1c6 --- /dev/null +++ b/tests/circuitpython/bad3.toml @@ -0,0 +1 @@ +string = diff --git a/tests/circuitpython/dotenv_test.env b/tests/circuitpython/dotenv_test.env deleted file mode 100644 index 63753b0ea4..0000000000 --- a/tests/circuitpython/dotenv_test.env +++ /dev/null @@ -1,37 +0,0 @@ -# Key "notpresent" is not present - # comment preceded by spaces -plain_value=value -value_with_comment=value # value followed by a comment -quoted_value='value' -quoted_value_with_comment='value' # quoted value followed by a comment -should_be_none -should_be_empty_string= -should_be_hash=# -quoted_should_be_empty_string='' -duplicate_key=wrong -duplicate_key=right -value_with_hash=value#value -quoted_value_with_hash='value#value' -multi_line_value='multi -line' - space_before_key=value -space_before_value= value -space_before_hash_value= #value -space_after_key =value -space_after_key_before_value = value -quoted_then_comment='value'#comment -hash_with_spaces=#value value -aa🐍bb=key with emoji -value_with_emoji=aa🐍bb -sz0=x -sz1=xx -sz2=xxxx -sz3=xxxxxxxx -sz4=xxxxxxxxxxxxxxxx -sz5=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -sz6=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -sz7=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -sz8=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -sz9=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -sz10=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -sz11=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx diff --git a/tests/circuitpython/dotenv_test.py b/tests/circuitpython/dotenv_test.py deleted file mode 100644 index 109a3bf221..0000000000 --- a/tests/circuitpython/dotenv_test.py +++ /dev/null @@ -1,31 +0,0 @@ -import dotenv - -FILE = __file__.rsplit(".", 1)[0] + ".env" - -print(f"notpresent={dotenv.get_key(FILE, 'notpresent')}") -print(f"plain_value={dotenv.get_key(FILE, 'plain_value')}") -print(f"value_with_comment={dotenv.get_key(FILE, 'value_with_comment')}") -print(f"quoted_value={dotenv.get_key(FILE, 'quoted_value')}") -print(f"quoted_value_with_comment={dotenv.get_key(FILE, 'quoted_value_with_comment')}") -print(f"should_be_none={dotenv.get_key(FILE, 'should_be_none')}") -print(f"should_be_empty_string={dotenv.get_key(FILE, 'should_be_empty_string')}") -print(f"should_be_hash={dotenv.get_key(FILE, 'should_be_hash')}") -print(f"quoted_should_be_empty_string={dotenv.get_key(FILE, 'quoted_should_be_empty_string')}") -print(f"duplicate_key={dotenv.get_key(FILE, 'duplicate_key')}") -### This is the a difference from CPython dotenv. The trailing #value is taken as a comment. -print(f"value_with_hash={dotenv.get_key(FILE, 'value_with_hash')}") -print(f"quoted_value_with_hash={dotenv.get_key(FILE, 'quoted_value_with_hash')}") -print(f"multi_line_value={dotenv.get_key(FILE, 'multi_line_value')}") -print(f"space_before_key={dotenv.get_key(FILE, 'space_before_key')}") -print(f"space_before_value={dotenv.get_key(FILE, 'space_before_value')}") -print(f"space_before_hash_value={dotenv.get_key(FILE, 'space_before_hash_value')}") -print(f"space_after_key={dotenv.get_key(FILE, 'space_after_key')}") -print(f"space_after_key_before_value={dotenv.get_key(FILE, 'space_after_key_before_value')}") -print(f"quoted_then_comment={dotenv.get_key(FILE, 'quoted_then_comment')}") -print(f"hash_with_spaces={dotenv.get_key(FILE, 'hash_with_spaces')}") -print(f"aa🐍bb={dotenv.get_key(FILE, 'aa🐍bb')}") -print(f"value_with_emoji={dotenv.get_key(FILE, 'value_with_emoji')}") - -for i in range(12): - key = f"sz{i}" - print(f"len({key})={len(dotenv.get_key(FILE, key))}") diff --git a/tests/circuitpython/dotenv_test.py.exp b/tests/circuitpython/dotenv_test.py.exp deleted file mode 100644 index e0ed5f1505..0000000000 --- a/tests/circuitpython/dotenv_test.py.exp +++ /dev/null @@ -1,35 +0,0 @@ -notpresent=None -plain_value=value -value_with_comment=value -quoted_value=value -quoted_value_with_comment=value -should_be_none=None -should_be_empty_string= -should_be_hash=# -quoted_should_be_empty_string= -duplicate_key=right -value_with_hash=value -quoted_value_with_hash=value#value -multi_line_value=multi -line -space_before_key=value -space_before_value=value -space_before_hash_value=#value -space_after_key=value -space_after_key_before_value=value -quoted_then_comment=value -hash_with_spaces=#value value -aa🐍bb=key with emoji -value_with_emoji=aa🐍bb -len(sz0)=1 -len(sz1)=2 -len(sz2)=4 -len(sz3)=8 -len(sz4)=16 -len(sz5)=32 -len(sz6)=64 -len(sz7)=128 -len(sz8)=256 -len(sz9)=512 -len(sz10)=1024 -len(sz11)=2048 diff --git a/tests/circuitpython/environ_test.py b/tests/circuitpython/environ_test.py new file mode 100644 index 0000000000..46ceff5c9d --- /dev/null +++ b/tests/circuitpython/environ_test.py @@ -0,0 +1,42 @@ +import os + +try: + from _environ import get_key +except: + # Because run-tests.py suppresses site-packages, this test can't be run + # on the host interpreter. However, it can be run manually to + # generate/update the expected file. + # + # After 3.11 becomes standard, change this to use tomllib. + import tomlkit + + def get_key(filename, key): + with open(filename) as f: + s = tomlkit.load(f) + return s.get(key, None) + + +def run_test(f, k=None): + try: + v = get_key(f"{BASE}/{f}.toml", k or f) + print(f, k, repr(v)) + except Exception as e: + print(f, k, "err") + + +if "/" in __file__: + BASE = __file__.rsplit("/", 1)[0] +else: + BASE = "." + +run_test("good", "notpresent") +run_test("good", "string") +run_test("good", "number") +run_test("good", "cstring") +run_test("good", "cnumber") +run_test("good", "subvalue") +for i in range(8): + run_test("good", f"string{i}") +run_test("bad1", "string") +run_test("bad2", "string") +run_test("bad3", "string") diff --git a/tests/circuitpython/environ_test.py.exp b/tests/circuitpython/environ_test.py.exp new file mode 100644 index 0000000000..f168b089c0 --- /dev/null +++ b/tests/circuitpython/environ_test.py.exp @@ -0,0 +1,17 @@ +good notpresent None +good string 'hello world' +good number 7 +good cstring 'hello comment' +good cnumber 127 +good subvalue None +good string0 None +good string1 '\n' +good string2 'Áx' +good string3 'Áx' +good string4 '\x0c"\\' +good string5 '\t\r\x08' +good string6 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +good string7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +bad1 string err +bad2 string err +bad3 string err diff --git a/tests/circuitpython/good.toml b/tests/circuitpython/good.toml new file mode 100644 index 0000000000..17e5c054f4 --- /dev/null +++ b/tests/circuitpython/good.toml @@ -0,0 +1,14 @@ +# comment +string = "hello world" +number = 7 + cstring = "hello comment" # comment + cnumber = 0x7f # comment +string1= "\n" +string2 ="\u00c1x" +string3 = "\U000000c1x" +string4 = "\f\"\\" +string5 = "\t\r\b" +string6 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +string7 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +[section] +subvalue = "hi" diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 782ab95cc8..4483eeb0c1 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -29,10 +29,10 @@ RuntimeError: ame__ mport -builtins micropython _asyncio _thread -_uasyncio aesio array binascii -bitmaptools btree cexample cmath -collections cppexample displayio dotenv +builtins micropython _asyncio _environ +_thread _uasyncio aesio array +binascii bitmaptools btree cexample +cmath collections cppexample displayio errno ffi framebuf gc gifio hashlib json math qrio rainbowio re sys From 1fe05cb8cd5d46252dff65436b58d5bfb965e23b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 12:44:34 -0600 Subject: [PATCH 249/357] pico w: re-use previous connection if ssid matches --- ports/raspberrypi/common-hal/wifi/Radio.c | 26 +++++++++++++++++++++++ ports/raspberrypi/common-hal/wifi/Radio.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 313363dd32..a13222152b 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -206,6 +206,22 @@ void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self) { */ } +static bool connection_unchanged(wifi_radio_obj_t *self, const uint8_t *ssid, size_t ssid_len) { + if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_STA) != CYW43_LINK_UP) { + mp_printf(&mp_plat_print, "(not connected)\n"); + return false; + } + if (ssid_len != self->connected_ssid_len) { + mp_printf(&mp_plat_print, "(length mismatch)\n"); + return false; + } + if (memcmp(ssid, self->connected_ssid, self->connected_ssid_len)) { + mp_printf(&mp_plat_print, "(ssid mismatch)\n"); + return false; + } + return true; +} + wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len) { if (!common_hal_wifi_radio_get_enabled(self)) { mp_raise_RuntimeError(translate("Wifi is not enabled")); @@ -215,11 +231,19 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t mp_raise_RuntimeError(translate("Wifi is in access point mode.")); } + if (ssid_len > 32) { + return WIFI_RADIO_ERROR_CONNECTION_FAIL; + } size_t timeout_ms = timeout <= 0 ? 8000 : (size_t)MICROPY_FLOAT_C_FUN(ceil)(timeout * 1000); uint64_t start = port_get_raw_ticks(NULL); uint64_t deadline = start + timeout_ms; + if (connection_unchanged(self, ssid, ssid_len)) { + mp_printf(&mp_plat_print, "re-used existing wifi connection"); + return WIFI_RADIO_ERROR_NONE; + } + // disconnect common_hal_wifi_radio_stop_station(self); @@ -237,6 +261,8 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t switch (result) { case CYW43_LINK_UP: + memcpy(self->connected_ssid, ssid, ssid_len); + self->connected_ssid_len = ssid_len; bindings_cyw43_wifi_enforce_pm(); return WIFI_RADIO_ERROR_NONE; case CYW43_LINK_FAIL: diff --git a/ports/raspberrypi/common-hal/wifi/Radio.h b/ports/raspberrypi/common-hal/wifi/Radio.h index b2e9df9e3a..a4125fe7ba 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.h +++ b/ports/raspberrypi/common-hal/wifi/Radio.h @@ -35,6 +35,8 @@ typedef struct { mp_obj_base_t base; char hostname[254]; // hostname max is 253 chars, + 1 for trailing NUL wifi_scannednetworks_obj_t *current_scan; + uint8_t connected_ssid[32]; + uint8_t connected_ssid_len; bool enabled; } wifi_radio_obj_t; From 47339d42489822ecc65367f1e94328d144e0bb84 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 12:56:24 -0600 Subject: [PATCH 250/357] make a settings.toml file on boards that support the feature --- supervisor/shared/filesystem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 01aba0a9ac..2c963b78ef 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -129,6 +129,9 @@ bool filesystem_init(bool create_allowed, bool force_create) { make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index"); make_empty_file(&vfs_fat->fatfs, "/.Trashes"); make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log"); + #if CIRCUITPY_ENVIRON + make_empty_file(&vfs_fat->fatfs, "/settings.toml"); + #endif // make a sample code.py file make_sample_code_file(&vfs_fat->fatfs); From 4e7d65251fe765ba7010b98d9bf6f5037ac1a6ba Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 8 Dec 2022 14:09:44 -0500 Subject: [PATCH 251/357] Add pin for charge rate for Seeed XIAO nRF52840 Sense --- ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/pins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/pins.c b/ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/pins.c index 00fa2c1ed5..8714f9bf8c 100644 --- a/ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/pins.c +++ b/ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/pins.c @@ -52,6 +52,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_READ_BATT_ENABLE),MP_ROM_PTR(&pin_P0_14)}, {MP_ROM_QSTR(MP_QSTR_VBATT),MP_ROM_PTR(&pin_P0_31)}, {MP_ROM_QSTR(MP_QSTR_CHARGE_STATUS),MP_ROM_PTR(&pin_P0_17)}, + {MP_ROM_QSTR(MP_QSTR_CHARGE_RATE),MP_ROM_PTR(&pin_P0_13)}, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From a05829528b8a2525b1e887b708838fa3af99035e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 13:36:48 -0600 Subject: [PATCH 252/357] _environ: update documentation --- shared-bindings/_environ/__init__.c | 58 ++++++++++++++++------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/shared-bindings/_environ/__init__.c b/shared-bindings/_environ/__init__.c index 81d778f3ed..a35181b754 100644 --- a/shared-bindings/_environ/__init__.c +++ b/shared-bindings/_environ/__init__.c @@ -35,47 +35,55 @@ #include "py/runtime.h" #include "shared-bindings/_environ/__init__.h" -//| """Functions to manage environment variables from a .env file. +//| """Functions to manage environment variables from a settings.toml file. //| -//| A subset of the CPython `_environ library `_. It does -//| not support variables or double quotes. +//| This library can read a subset of `toml files `_. //| -//| Keys and values may be put in single quotes. -//| ``\`` and ``'`` are escaped by ``\`` in single quotes. Newlines can occur in quotes for multiline values. -//| Comments start with ``#`` and apply for the rest of the line. -//| A ``#`` immediately following an ``=`` is part of the value, not the start of a comment, -//| and a ``#`` embedded in a value without whitespace will be part of that value. -//| This corresponds to how assignments and comments work in most Unix shells. +//| It is recommended to not use this module directly. Instead, retrieve string +//| values using `os.getenv`. //| +//| Due to technical limitations it probably also accepts some files that are +//| not valid TOML files; bugs of this nature are subject to change (i.e., be +//| fixed) without the usual deprecation period for incompatible changes. +//| +//| Details of the format understood by this module: +//| * the content is required to be in UTF-8 encoding +//| * the supported data types are string and integer +//| * only integers and basic strings are supported +//| * only integers supported by strtol are supported (no 0o, no 0b, no +//| underscores 1_000, 011 is 9, not 11) +//| * In quoted strings, all standard eescape codes, including ``\\uxxxx`` +//| and ``\\Uxxxxxxxx``, are supported +//| * only bare keys are supported +//| * duplicate keys are not diagnosed. +//| * comments are supported +//| * only values from the "root table" can be retrieved (parsing ends when it +//| encounters a line starting with [) +//| * due to technical limitations, the content of multi-line +//| strings can erroneously be parsed as a value. //| //| File format example: //| //| .. code-block:: //| -//| key=value -//| key2 = value2 -//| 'key3' = 'value with spaces' +//| str_key="Hello world" # with trailing comment +//| int_key = 7 +//| unicode_key="👨" +//| unicode_key2="\\U0001f468" # same as above +//| escape_codes="supported, including \\r\\n\\"\\\\" //| # comment -//| key4 = value3 # comment 2 -//| 'key5'=value4 -//| key=value5 # overrides the first one -//| multiline = 'hello -//| world -//| how are you?' -//| # The #'s below will be included in the value. They do not start a comment. -//| key6=#value -//| key7=abc#def +//| [subtable] +//| subvalue="cannot retrieve this using _environ or getenv" //| //| """ //| //| import typing //| -//| def get_key(_environ_path: str, key_to_get: str) -> Optional[str]: -//| """Get the value for the given key from the given .env file. If the key occurs multiple -//| times in the file, then the last value will be returned. +//| def get_key(_environ_path: str, key_to_get: str) -> Union[str, int, None]: +//| """Get the value for the given key from the given .env file. //| -//| Returns None if the key isn't found or doesn't have a value.""" +//| Returns None if the key isn't found""" //| ... //| STATIC mp_obj_t __environ_get_key(mp_obj_t path_in, mp_obj_t key_to_get_in) { From 19ad1d5f53e649de34214611f367c8f3a54b550e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 14:12:59 -0600 Subject: [PATCH 253/357] update translations --- locale/circuitpython.pot | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 16a682cfdd..43c7a79ff7 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1002,7 +1002,7 @@ msgstr "" msgid "File exists" msgstr "" -#: shared-module/dotenv/__init__.c +#: shared-module/_environ/__init__.c msgid "File not found" msgstr "" @@ -1062,6 +1062,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -1188,7 +1190,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c -#: shared-module/dotenv/__init__.c +#: shared-module/_environ/__init__.c msgid "Internal error" msgstr "" @@ -1235,7 +1237,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: shared-module/dotenv/__init__.c +#: shared-module/_environ/__init__.c #, c-format msgid "Invalid byte %.*s" msgstr "" @@ -1270,7 +1272,7 @@ msgstr "" msgid "Invalid state" msgstr "" -#: shared-module/dotenv/__init__.c +#: shared-module/_environ/__init__.c msgid "Invalid unicode escape" msgstr "" @@ -1278,7 +1280,7 @@ msgstr "" msgid "Key must be 16, 24, or 32 bytes long" msgstr "" -#: shared-module/dotenv/__init__.c +#: shared-module/_environ/__init__.c msgid "Key not found" msgstr "" @@ -2280,7 +2282,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3161,7 +3163,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3540,7 +3542,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" From 170918995c1a3fde1b9c7694e451c2292181fc45 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 14:14:48 -0600 Subject: [PATCH 254/357] fix mistaken code formatting I wanted to use the idiom ```c #if GUARD if (condition) { alternate code } else #else { common default code } ``` idiom, in which the common default code is conditioned both on a compile-time check and a run-time check. However, I got it wrong and uncrustify chipped in, adding extra brackets around a following piece of code and re-indenting it. --- ports/espressif/common-hal/_bleio/Adapter.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index 121beb8e90..f89848f782 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -107,18 +107,16 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable if (result == ENVIRON_OK) { ble_svc_gap_device_name_set(ble_name); } else - #else + #endif { ble_svc_gap_device_name_set("CIRCUITPY"); } - #endif - {// Clear all of the internal connection objects. - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - bleio_connection_internal_t *connection = &bleio_connections[i]; - // Reset connection. - connection->conn_handle = BLEIO_HANDLE_INVALID; - } + // Clear all of the internal connection objects. + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connection_internal_t *connection = &bleio_connections[i]; + // Reset connection. + connection->conn_handle = BLEIO_HANDLE_INVALID; } cp_task = xTaskGetCurrentTaskHandle(); From 243ecc250289fe66fd3b7ccedba117f2ec8924fb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 14:18:22 -0600 Subject: [PATCH 255/357] remove debugging prints --- ports/raspberrypi/common-hal/wifi/Radio.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index a13222152b..4cd80fb4b7 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -208,15 +208,12 @@ void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self) { static bool connection_unchanged(wifi_radio_obj_t *self, const uint8_t *ssid, size_t ssid_len) { if (cyw43_tcpip_link_status(&cyw43_state, CYW43_ITF_STA) != CYW43_LINK_UP) { - mp_printf(&mp_plat_print, "(not connected)\n"); return false; } if (ssid_len != self->connected_ssid_len) { - mp_printf(&mp_plat_print, "(length mismatch)\n"); return false; } if (memcmp(ssid, self->connected_ssid, self->connected_ssid_len)) { - mp_printf(&mp_plat_print, "(ssid mismatch)\n"); return false; } return true; @@ -240,7 +237,6 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t uint64_t deadline = start + timeout_ms; if (connection_unchanged(self, ssid, ssid_len)) { - mp_printf(&mp_plat_print, "re-used existing wifi connection"); return WIFI_RADIO_ERROR_NONE; } From 3459fe322b45bd1443fca8e12126d3919aa8784c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 15:21:20 -0600 Subject: [PATCH 256/357] Withdraw the _environ module This existed solely for testing, so expose it a different way during the unix coverage build Also turn off os.getenv support on samd21. --- devices/ble_hci/common-hal/_bleio/Adapter.c | 8 +- docs/environment.rst | 36 ++++-- ports/atmel-samd/mpconfigport.mk | 1 + ports/espressif/common-hal/_bleio/Adapter.c | 8 +- ports/espressif/supervisor/port.c | 4 +- ports/nrf/common-hal/_bleio/Adapter.c | 8 +- ports/unix/coverage.c | 1 + ports/unix/main.c | 8 ++ .../unix/variants/coverage/mpconfigvariant.mk | 5 +- py/circuitpy_defns.mk | 4 +- py/circuitpy_mpconfig.mk | 4 +- shared-bindings/_environ/__init__.c | 108 ------------------ shared-bindings/_environ/__init__.h | 37 ------ shared-bindings/os/__init__.c | 4 + shared-bindings/os/__init__.h | 2 + shared-bindings/os/getenv.c | 1 + shared-module/os/__init__.c | 15 --- shared-module/{_environ => os}/__init__.h | 6 +- .../{_environ/__init__.c => os/getenv.c} | 39 ++++--- supervisor/shared/filesystem.c | 2 +- supervisor/shared/web_workflow/web_workflow.c | 14 +-- tests/circuitpython/environ_test.py | 4 +- 22 files changed, 93 insertions(+), 226 deletions(-) delete mode 100644 shared-bindings/_environ/__init__.c delete mode 100644 shared-bindings/_environ/__init__.h create mode 100644 shared-bindings/os/getenv.c rename shared-module/{_environ => os}/__init__.h (89%) rename shared-module/{_environ/__init__.c => os/getenv.c} (88%) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 018b65de12..f558d66d40 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -49,8 +49,8 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" -#if CIRCUITPY_ENVIRON -#include "shared-bindings/_environ/__init__.h" +#if CIRCUITPY_OS_GETENV +#include "shared-bindings/os/__init__.h" #endif #define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION)) @@ -284,8 +284,8 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0 STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) { mp_int_t name_len = 0; - #if CIRCUITPY_ENVIRON - mp_obj_t name = common_hal__environ_get_key("CIRCUITPY_BLE_NAME"); + #if CIRCUITPY_OS_GETENV + mp_obj_t name = common_hal_os_getenv("CIRCUITPY_BLE_NAME", mp_const_none); if (name != mp_const_none) { mp_arg_validate_type_string(name, MP_QSTR_CIRCUITPY_BLE_NAME); self->name = name; diff --git a/docs/environment.rst b/docs/environment.rst index 457e5c3f88..0a370d64d9 100644 --- a/docs/environment.rst +++ b/docs/environment.rst @@ -6,23 +6,33 @@ variables are commonly used to store "secrets" such as Wi-Fi passwords and API keys. This method *does not* make them secure. It only separates them from the code. -CircuitPython supports these by parsing a subset of the `toml `_ file format internally. +CircuitPython uses a file called ``settings.toml`` at the drive root (no +folder) as the environment. User code can access the values from the file +using `os.getenv()`. It is recommended to save any values used repeatedly in a +variable because `os.getenv()` will parse the ``settings.toml`` file contents +on every access. -Here is a simple example: +CircuitPython only supports a subset of the full toml specification, see below +for more details. The subset is very "Python-like", which is a key reason we +selected the format. -.. code-block:: bash +Due to technical limitations it probably also accepts some files that are +not valid TOML files; bugs of this nature are subject to change (i.e., be +fixed) without the usual deprecation period for incompatible changes. - KEY1="value1" - # Comment - KEY2="value2\ncontains a newline" +File format example: - [SECTION] # Only values in the "root table" are parsed - SECTION_VALUE = ... # so this value cannot be seen by getenv +.. code-block:: + + str_key="Hello world" # with trailing comment + int_key = 7 + unicode_key="👨" + unicode_key2="\\U0001f468" # same as above + escape_codes="supported, including \\r\\n\\"\\\\" + # comment + [subtable] + subvalue="cannot retrieve this using _environ or getenv" -CircuitPython uses the ``settings.toml`` at the drive root (no folder) as the environment. -User code can access the values from the file using `os.getenv()`. It is -recommended to save any values used repeatedly in a variable because `os.getenv()` -will parse the ``settings.toml`` file contents on every access. Details of the toml language subset ----------------------------------- @@ -36,6 +46,8 @@ Details of the toml language subset * Duplicate keys are not diagnosed. * Comments are supported * Only values from the "root table" can be retrieved +* due to technical limitations, the content of multi-line + strings can erroneously be parsed as a value. CircuitPython behavior ---------------------- diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 05aed89eb2..72b1302227 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -33,6 +33,7 @@ CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_BUILTINS_POW3 ?= 0 CIRCUITPY_COMPUTED_GOTO_SAVE_SPACE ?= 1 CIRCUITPY_COUNTIO ?= 0 +CIRCUITPY_OS_GETENV ?= 0 # Not enough RAM for framebuffers CIRCUITPY_FRAMEBUFFERIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index f89848f782..7da1cd0b8c 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -59,8 +59,8 @@ #include "esp_bt.h" #include "esp_nimble_hci.h" -#if CIRCUITPY_ENVIRON -#include "shared-module/_environ/__init__.h" +#if CIRCUITPY_OS_GETENV +#include "shared-module/os/__init__.h" #endif bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; @@ -101,9 +101,9 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable ble_hs_cfg.sync_cb = _on_sync; // ble_hs_cfg.store_status_cb = ble_store_util_status_rr; - #if CIRCUITPY_ENVIRON + #if CIRCUITPY_OS_GETENV char ble_name[1 + MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH]; - _environ_err_t result = _environ_get_key_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name)); + os_environ_err_t result = common_hal_os_environ_get_key_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name)); if (result == ENVIRON_OK) { ble_svc_gap_device_name_set(ble_name); } else diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index e89fb8c976..2792792455 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -55,7 +55,7 @@ #include "shared-bindings/microcontroller/RunMode.h" #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/socketpool/__init__.h" -#include "shared-module/_environ/__init__.h" +#include "shared-module/os/__init__.h" #include "peripherals/rmt.h" #include "peripherals/timer.h" @@ -519,7 +519,7 @@ void port_idle_until_interrupt(void) { void port_post_boot_py(bool heap_valid) { if (!heap_valid && filesystem_present()) { mp_int_t reserved; - if (_environ_get_key_int("CIRCUITPY_RESERVED_PSRAM", &reserved) == ENVIRON_OK) { + if (common_hal_os_environ_get_key_int("CIRCUITPY_RESERVED_PSRAM", &reserved) == ENVIRON_OK) { common_hal_espidf_set_reserved_psram(reserved); } common_hal_espidf_reserve_psram(); diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 012430704a..f9e3bddc72 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -52,8 +52,8 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" -#if CIRCUITPY_ENVIRON -#include "shared-bindings/_environ/__init__.h" +#if CIRCUITPY_OS_GETENV +#include "shared-bindings/os/getenv.h" #endif #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) @@ -345,8 +345,8 @@ STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { mp_int_t name_len = 0; - #if CIRCUITPY_ENVIRON - mp_obj_t ble_name = common_hal__environ_get_key("CIRCUITPY_BLE_NAME"); + #if CIRCUITPY_OS_GETENV + mp_obj_t ble_name = common_hal_os_environ_get_key("CIRCUITPY_BLE_NAME"); if (ble_name != mp_const_none) { common_hal_bleio_adapter_set_name(self, mp_obj_str_get_str(ble_name)); return; diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index 0e4c6dbd48..8463c169e4 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -95,6 +95,7 @@ STATIC const mp_rom_map_elem_t rawfile_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, { MP_ROM_QSTR(MP_QSTR_ioctl), MP_ROM_PTR(&mp_stream_ioctl_obj) }, + { MP_ROM_QSTR(MP_QSTR_ioctl), MP_ROM_PTR(&mp_stream_ioctl_obj) }, }; STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict, rawfile_locals_dict_table); diff --git a/ports/unix/main.c b/ports/unix/main.c index 5ebcf9193b..aa7c92dcff 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -420,6 +420,13 @@ STATIC void set_sys_argv(char *argv[], int argc, int start_arg) { #define PATHLIST_SEP_CHAR ':' #endif +mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t default_); +STATIC mp_obj_t get_key(mp_obj_t path_in, mp_obj_t key_to_get_in) { + return common_hal_os_getenv_path(mp_obj_str_get_str(path_in), + mp_obj_str_get_str(key_to_get_in), mp_const_none); +} +MP_DEFINE_CONST_FUN_OBJ_2(get_key_obj, get_key); + MP_NOINLINE int main_(int argc, char **argv); int main(int argc, char **argv) { @@ -540,6 +547,7 @@ MP_NOINLINE int main_(int argc, char **argv) { MP_DECLARE_CONST_FUN_OBJ_0(extra_cpp_coverage_obj); mp_store_global(MP_QSTR_extra_coverage, MP_OBJ_FROM_PTR(&extra_coverage_obj)); mp_store_global(MP_QSTR_extra_cpp_coverage, MP_OBJ_FROM_PTR(&extra_cpp_coverage_obj)); + mp_store_global(MP_QSTR_get_key, MP_OBJ_FROM_PTR(&get_key_obj)); } #endif diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index a0e0f4f3bb..e351fc0836 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -33,7 +33,6 @@ SRC_BITMAP := \ shared-bindings/aesio/__init__.c \ shared-bindings/bitmaptools/__init__.c \ shared-bindings/displayio/Bitmap.c \ - shared-bindings/_environ/__init__.c \ shared-bindings/rainbowio/__init__.c \ shared-bindings/traceback/__init__.c \ shared-bindings/util.c \ @@ -45,7 +44,7 @@ SRC_BITMAP := \ shared-module/displayio/Bitmap.c \ shared-module/displayio/ColorConverter.c \ shared-module/displayio/ColorConverter.c \ - shared-module/_environ/__init__.c \ + shared-module/os/getenv.c \ shared-module/rainbowio/__init__.c \ shared-module/traceback/__init__.c \ shared-module/zlib/__init__.c \ @@ -56,7 +55,7 @@ CFLAGS += \ -DCIRCUITPY_AESIO=1 \ -DCIRCUITPY_BITMAPTOOLS=1 \ -DCIRCUITPY_DISPLAYIO_UNIX=1 \ - -DCIRCUITPY_ENVIRON=1 \ + -DCIRCUITPY_OS_GETENV=1 \ -DCIRCUITPY_GIFIO=1 \ -DCIRCUITPY_RAINBOWIO=1 \ -DCIRCUITPY_TRACEBACK=1 \ diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 7d8fa6bada..df3f664864 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -182,9 +182,6 @@ endif ifeq ($(CIRCUITPY_DISPLAYIO),1) SRC_PATTERNS += displayio/% endif -ifeq ($(CIRCUITPY_ENVIRON),1) -SRC_PATTERNS += _environ/% -endif ifeq ($(CIRCUITPY__EVE),1) SRC_PATTERNS += _eve/% endif @@ -618,6 +615,7 @@ SRC_SHARED_MODULE_ALL = \ onewireio/__init__.c \ onewireio/OneWire.c \ os/__init__.c \ + os/getenv.c \ paralleldisplay/ParallelBus.c \ qrio/__init__.c \ qrio/QRDecoder.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index a6a1118d2d..f0e145998b 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -215,8 +215,8 @@ CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) -CIRCUITPY_ENVIRON ?= $(CIRCUITPY_FULL_BUILD) -CFLAGS += -DCIRCUITPY_ENVIRON=$(CIRCUITPY_ENVIRON) +CIRCUITPY_OS_GETENV ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_OS_GETENV=$(CIRCUITPY_OS_GETENV) CIRCUITPY_ERRNO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO) diff --git a/shared-bindings/_environ/__init__.c b/shared-bindings/_environ/__init__.c deleted file mode 100644 index a35181b754..0000000000 --- a/shared-bindings/_environ/__init__.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2022 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 - -#include "extmod/vfs.h" -#include "lib/oofatfs/ff.h" -#include "lib/oofatfs/diskio.h" -#include "py/mpstate.h" -#include "py/obj.h" -#include "py/objstr.h" -#include "py/runtime.h" -#include "shared-bindings/_environ/__init__.h" - -//| """Functions to manage environment variables from a settings.toml file. -//| -//| This library can read a subset of `toml files `_. -//| -//| It is recommended to not use this module directly. Instead, retrieve string -//| values using `os.getenv`. -//| -//| Due to technical limitations it probably also accepts some files that are -//| not valid TOML files; bugs of this nature are subject to change (i.e., be -//| fixed) without the usual deprecation period for incompatible changes. -//| -//| Details of the format understood by this module: -//| * the content is required to be in UTF-8 encoding -//| * the supported data types are string and integer -//| * only integers and basic strings are supported -//| * only integers supported by strtol are supported (no 0o, no 0b, no -//| underscores 1_000, 011 is 9, not 11) -//| * In quoted strings, all standard eescape codes, including ``\\uxxxx`` -//| and ``\\Uxxxxxxxx``, are supported -//| * only bare keys are supported -//| * duplicate keys are not diagnosed. -//| * comments are supported -//| * only values from the "root table" can be retrieved (parsing ends when it -//| encounters a line starting with [) -//| * due to technical limitations, the content of multi-line -//| strings can erroneously be parsed as a value. -//| -//| File format example: -//| -//| .. code-block:: -//| -//| str_key="Hello world" # with trailing comment -//| int_key = 7 -//| unicode_key="👨" -//| unicode_key2="\\U0001f468" # same as above -//| escape_codes="supported, including \\r\\n\\"\\\\" -//| # comment -//| [subtable] -//| subvalue="cannot retrieve this using _environ or getenv" -//| -//| """ -//| -//| import typing -//| - -//| def get_key(_environ_path: str, key_to_get: str) -> Union[str, int, None]: -//| """Get the value for the given key from the given .env file. -//| -//| Returns None if the key isn't found""" -//| ... -//| -STATIC mp_obj_t __environ_get_key(mp_obj_t path_in, mp_obj_t key_to_get_in) { - return common_hal__environ_get_key_path(mp_obj_str_get_str(path_in), - mp_obj_str_get_str(key_to_get_in)); -} -MP_DEFINE_CONST_FUN_OBJ_2(_environ_get_key_obj, __environ_get_key); - -STATIC const mp_rom_map_elem_t _environ_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__environ) }, - - { MP_ROM_QSTR(MP_QSTR_get_key), MP_ROM_PTR(&_environ_get_key_obj) }, -}; - -STATIC MP_DEFINE_CONST_DICT(_environ_module_globals, _environ_module_globals_table); - -const mp_obj_module_t _environ_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&_environ_module_globals, -}; - -MP_REGISTER_MODULE(MP_QSTR__environ, _environ_module, CIRCUITPY_ENVIRON); diff --git a/shared-bindings/_environ/__init__.h b/shared-bindings/_environ/__init__.h deleted file mode 100644 index 7779f3ac82..0000000000 --- a/shared-bindings/_environ/__init__.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 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. - */ - -#pragma once - -#include -#include - -#include "py/objtuple.h" - -#include "shared-module/_environ/__init__.h" - -mp_obj_t common_hal__environ_get_key_path(const char *path, const char *key); -mp_obj_t common_hal__environ_get_key(const char *key); diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 1260903203..b2fb8ff095 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -92,6 +92,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); //| ... //| STATIC mp_obj_t os_getenv(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + #if CIRCUITPY_OS_GETENV enum { ARG_key, ARG_default }; static const mp_arg_t allowed_args[] = { { MP_QSTR_key, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -101,6 +102,9 @@ STATIC mp_obj_t os_getenv(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_ mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); return common_hal_os_getenv(mp_obj_str_get_str(args[ARG_key].u_obj), args[ARG_default].u_obj); + #else + return mp_const_none; + #endif } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(os_getenv_obj, 1, os_getenv); diff --git a/shared-bindings/os/__init__.h b/shared-bindings/os/__init__.h index 00d8c28a50..49b12cd52a 100644 --- a/shared-bindings/os/__init__.h +++ b/shared-bindings/os/__init__.h @@ -38,6 +38,8 @@ mp_obj_t common_hal_os_uname(void); void common_hal_os_chdir(const char *path); mp_obj_t common_hal_os_getcwd(void); mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_); +mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t default_); + mp_obj_t common_hal_os_listdir(const char *path); void common_hal_os_mkdir(const char *path); void common_hal_os_remove(const char *path); diff --git a/shared-bindings/os/getenv.c b/shared-bindings/os/getenv.c new file mode 100644 index 0000000000..fdb5f0bb50 --- /dev/null +++ b/shared-bindings/os/getenv.c @@ -0,0 +1 @@ +// this file needs to exist but does not have any content diff --git a/shared-module/os/__init__.c b/shared-module/os/__init__.c index 57e7e62932..4a4c02e636 100644 --- a/shared-module/os/__init__.c +++ b/shared-module/os/__init__.c @@ -36,10 +36,6 @@ #include "py/runtime.h" #include "shared-bindings/os/__init__.h" -#if CIRCUITPY_ENVIRON -#include "shared-bindings/_environ/__init__.h" -#endif - // This provides all VFS related OS functions so that ports can share the code // as needed. It does not provide uname. @@ -111,17 +107,6 @@ mp_obj_t common_hal_os_getcwd(void) { return mp_vfs_getcwd(); } -mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_) { - #if CIRCUITPY_ENVIRON - mp_obj_t env_obj = common_hal__environ_get_key(key); - // TODO must be a str object - if (env_obj != mp_const_none) { - return env_obj; - } - #endif - return default_; -} - mp_obj_t common_hal_os_listdir(const char *path) { mp_obj_t path_out; mp_vfs_mount_t *vfs = lookup_dir_path(path, &path_out); diff --git a/shared-module/_environ/__init__.h b/shared-module/os/__init__.h similarity index 89% rename from shared-module/_environ/__init__.h rename to shared-module/os/__init__.h index c96eb028b8..48bd06195e 100644 --- a/shared-module/_environ/__init__.h +++ b/shared-module/os/__init__.h @@ -33,13 +33,13 @@ typedef enum { ENVIRON_ERR_LENGTH, ENVIRON_ERR_NOT_FOUND, ENVIRON_ERR_UNEXPECTED = 0xff00, // logical or'd with the byte value -} _environ_err_t; +} os_environ_err_t; // Allocation free version that returns the full length of the value. // If it fits, the return value is 0-terminated. If the value doesn't fit, // *value_len may be an over-estimate but never an under-estimate. -_environ_err_t _environ_get_key_str(const char *key, char *value, size_t value_len); +os_environ_err_t common_hal_os_environ_get_key_str(const char *key, char *value, size_t value_len); // Returns ENVIRON_ERR_OK and sets value to the read value. Returns // ENVIRON_ERR_... if the value was not numeric. allocation-free. -_environ_err_t _environ_get_key_int(const char *key, mp_int_t *value); +os_environ_err_t common_hal_os_environ_get_key_int(const char *key, mp_int_t *value); diff --git a/shared-module/_environ/__init__.c b/shared-module/os/getenv.c similarity index 88% rename from shared-module/_environ/__init__.c rename to shared-module/os/getenv.c index 7e6e133e1a..ec9edbacac 100644 --- a/shared-module/_environ/__init__.c +++ b/shared-module/os/getenv.c @@ -27,7 +27,8 @@ #include #include -#include "shared-bindings/_environ/__init__.h" +#include "shared-bindings/os/__init__.h" +#include "shared-module/os/__init__.h" #include "py/gc.h" #include "py/misc.h" @@ -177,7 +178,7 @@ STATIC bool key_matches(file_arg *active_file, const char *key) { return true; } -STATIC _environ_err_t read_unicode_escape(file_arg *active_file, int sz, vstr_t *buf) { +STATIC os_environ_err_t read_unicode_escape(file_arg *active_file, int sz, vstr_t *buf) { char hex_buf[sz + 1]; for (int i = 0; i < sz; i++) { hex_buf[i] = get_next_byte(active_file); @@ -196,7 +197,7 @@ STATIC _environ_err_t read_unicode_escape(file_arg *active_file, int sz, vstr_t } // Read a quoted string -STATIC _environ_err_t read_string_value(file_arg *active_file, vstr_t *buf) { +STATIC os_environ_err_t read_string_value(file_arg *active_file, vstr_t *buf) { while (true) { int character = get_next_byte(active_file); switch (character) { @@ -243,7 +244,7 @@ STATIC _environ_err_t read_string_value(file_arg *active_file, vstr_t *buf) { case 'U': case 'u': { int sz = (character == 'u') ? 4 : 8; - _environ_err_t res; + os_environ_err_t res; res = read_unicode_escape(active_file, sz, buf); if (res != ENVIRON_OK) { return res; @@ -261,7 +262,7 @@ STATIC _environ_err_t read_string_value(file_arg *active_file, vstr_t *buf) { } // Read a numeric value (non-quoted value) as a string -STATIC _environ_err_t read_bare_value(file_arg *active_file, vstr_t *buf, int first_character) { +STATIC os_environ_err_t read_bare_value(file_arg *active_file, vstr_t *buf, int first_character) { int character = first_character; while (true) { switch (character) { @@ -291,13 +292,13 @@ STATIC mp_int_t read_value(file_arg *active_file, vstr_t *buf, bool *quoted) { } } -STATIC _environ_err_t _environ_get_key_vstr(const char *path, const char *key, vstr_t *buf, bool *quoted) { +STATIC os_environ_err_t os_environ_get_key_vstr(const char *path, const char *key, vstr_t *buf, bool *quoted) { file_arg active_file; if (!open_file(path, &active_file)) { return ENVIRON_ERR_OPEN; } - _environ_err_t result = ENVIRON_ERR_NOT_FOUND; + os_environ_err_t result = ENVIRON_ERR_NOT_FOUND; while (!is_eof(&active_file)) { if (key_matches(&active_file, key)) { result = read_value(&active_file, buf, quoted); @@ -307,10 +308,10 @@ STATIC _environ_err_t _environ_get_key_vstr(const char *path, const char *key, v return result; } -STATIC _environ_err_t _environ_get_key_buf_terminated(const char *key, char *value, size_t value_len, bool *quoted) { +STATIC os_environ_err_t os_environ_get_key_buf_terminated(const char *key, char *value, size_t value_len, bool *quoted) { vstr_t buf; vstr_init_fixed_buf(&buf, value_len, value); - _environ_err_t result = _environ_get_key_vstr(ENVIRON_PATH, key, &buf, quoted); + os_environ_err_t result = os_environ_get_key_vstr(ENVIRON_PATH, key, &buf, quoted); if (result == ENVIRON_OK) { vstr_add_byte_nonstd(&buf, 0); @@ -322,16 +323,16 @@ STATIC _environ_err_t _environ_get_key_buf_terminated(const char *key, char *val return result; } -_environ_err_t _environ_get_key_str(const char *key, char *value, size_t value_len) { +os_environ_err_t common_hal_os_environ_get_key_str(const char *key, char *value, size_t value_len) { bool quoted; - _environ_err_t result = _environ_get_key_buf_terminated(key, value, value_len, "ed); + os_environ_err_t result = os_environ_get_key_buf_terminated(key, value, value_len, "ed); if (result == ENVIRON_OK && !quoted) { result = ENVIRON_ERR_UNEXPECTED | value[0]; } return result; } -STATIC void throw__environ_error(_environ_err_t error) { +STATIC void throw__environ_error(os_environ_err_t error) { if (error == ENVIRON_OK) { return; } @@ -360,14 +361,14 @@ STATIC void throw__environ_error(_environ_err_t error) { } } -mp_obj_t common_hal__environ_get_key_path(const char *path, const char *key) { +mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t default_) { vstr_t buf; bool quoted; vstr_init(&buf, 64); - _environ_err_t result = _environ_get_key_vstr(path, key, &buf, "ed); + os_environ_err_t result = os_environ_get_key_vstr(path, key, &buf, "ed); if (result == ENVIRON_ERR_NOT_FOUND) { - return mp_const_none; + return default_; } throw__environ_error(result); @@ -378,14 +379,14 @@ mp_obj_t common_hal__environ_get_key_path(const char *path, const char *key) { } } -mp_obj_t common_hal__environ_get_key(const char *key) { - return common_hal__environ_get_key_path(ENVIRON_PATH, key); +mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_) { + return common_hal_os_getenv_path(ENVIRON_PATH, key, default_); } -_environ_err_t _environ_get_key_int(const char *key, mp_int_t *value) { +os_environ_err_t common_hal_os_environ_get_key_int(const char *key, mp_int_t *value) { char buf[16]; bool quoted; - _environ_err_t result = _environ_get_key_buf_terminated(key, buf, sizeof(buf), "ed); + os_environ_err_t result = os_environ_get_key_buf_terminated(key, buf, sizeof(buf), "ed); if (result != ENVIRON_OK) { return result; } diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 2c963b78ef..1eab59c384 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -129,7 +129,7 @@ bool filesystem_init(bool create_allowed, bool force_create) { make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index"); make_empty_file(&vfs_fat->fatfs, "/.Trashes"); make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log"); - #if CIRCUITPY_ENVIRON + #if CIRCUITPY_OS_GETENV make_empty_file(&vfs_fat->fatfs, "/settings.toml"); #endif // make a sample code.py file diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index d54f853891..ab9ded66a3 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -64,8 +64,8 @@ #include "shared-bindings/wifi/__init__.h" #endif -#if CIRCUITPY_ENVIRON -#include "shared-module/_environ/__init__.h" +#if CIRCUITPY_OS_GETENV +#include "shared-module/os/__init__.h" #endif enum request_state { @@ -244,19 +244,19 @@ void supervisor_web_workflow_status(void) { #endif void supervisor_start_web_workflow(void) { - #if CIRCUITPY_WEB_WORKFLOW && CIRCUITPY_WIFI && CIRCUITPY_ENVIRON + #if CIRCUITPY_WEB_WORKFLOW && CIRCUITPY_WIFI && CIRCUITPY_OS_GETENV char ssid[33]; char password[64]; size_t ssid_len = 0; size_t password_len = 0; - _environ_err_t result = _environ_get_key_str("CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid)); + os_environ_err_t result = common_hal_os_environ_get_key_str("CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid)); if (result != ENVIRON_OK) { return; } - result = _environ_get_key_str("CIRCUITPY_WIFI_PASSWORD", password, sizeof(password)); + result = common_hal_os_environ_get_key_str("CIRCUITPY_WIFI_PASSWORD", password, sizeof(password)); if (result != ENVIRON_OK) { return; } @@ -283,7 +283,7 @@ void supervisor_start_web_workflow(void) { mp_int_t new_port = web_api_port; // (leaves new_port unchanged on any failure) - (void)_environ_get_key_int("CIRCUITPY_WEB_API_PORT", &new_port); + (void)common_hal_os_environ_get_key_int("CIRCUITPY_WEB_API_PORT", &new_port); bool first_start = pool.base.type != &socketpool_socketpool_type; bool port_changed = new_port != web_api_port; @@ -320,7 +320,7 @@ void supervisor_start_web_workflow(void) { const size_t api_password_len = sizeof(_api_password) - 1; - result = _environ_get_key_str("CIRCUITPY_WEB_API_PASSWORD", _api_password + 1, api_password_len); + result = common_hal_os_environ_get_key_str("CIRCUITPY_WEB_API_PASSWORD", _api_password + 1, api_password_len); if (result == ENVIRON_OK) { _api_password[0] = ':'; _base64_in_place(_api_password, strlen(_api_password), sizeof(_api_password) - 1); diff --git a/tests/circuitpython/environ_test.py b/tests/circuitpython/environ_test.py index 46ceff5c9d..8dfab8812c 100644 --- a/tests/circuitpython/environ_test.py +++ b/tests/circuitpython/environ_test.py @@ -1,8 +1,8 @@ import os try: - from _environ import get_key -except: + get_key +except NameError: # Because run-tests.py suppresses site-packages, this test can't be run # on the host interpreter. However, it can be run manually to # generate/update the expected file. From f30d3ba02e23a30497d38b4905c1dab3194953fe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 15:39:19 -0600 Subject: [PATCH 257/357] update expected result --- tests/unix/extra_coverage.py.exp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 4483eeb0c1..582d90e1bc 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -29,22 +29,21 @@ RuntimeError: ame__ mport -builtins micropython _asyncio _environ -_thread _uasyncio aesio array -binascii bitmaptools btree cexample -cmath collections cppexample displayio -errno ffi framebuf gc -gifio hashlib json math -qrio rainbowio re sys -termios traceback ubinascii uctypes -uerrno uheapq uio ujson -ulab ulab.numpy ulab.numpy.fft -ulab.numpy.linalg ulab.scipy -ulab.scipy.linalg ulab.scipy.optimize -ulab.scipy.signal ulab.scipy.special -ulab.utils uos urandom ure -uselect ustruct utime utimeq -uzlib zlib +builtins micropython _asyncio _thread +_uasyncio aesio array binascii +bitmaptools btree cexample cmath +collections cppexample displayio errno +ffi framebuf gc gifio +hashlib json math qrio +rainbowio re sys termios +traceback ubinascii uctypes uerrno +uheapq uio ujson ulab +ulab.numpy ulab.numpy.fft ulab.numpy.linalg +ulab.scipy ulab.scipy.linalg +ulab.scipy.optimize ulab.scipy.signal +ulab.scipy.special ulab.utils uos +urandom ure uselect ustruct +utime utimeq uzlib zlib ime utime utimeq From 3cb628d290d80fd0f657e1b0bdb6af54c40335a5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 16:45:58 -0600 Subject: [PATCH 258/357] fix nrf build --- ports/nrf/common-hal/_bleio/Adapter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index f9e3bddc72..8948be1a5d 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -53,7 +53,7 @@ #include "shared-bindings/time/__init__.h" #if CIRCUITPY_OS_GETENV -#include "shared-bindings/os/getenv.h" +#include "shared-bindings/os/__init__.h" #endif #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) @@ -346,7 +346,7 @@ STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { mp_int_t name_len = 0; #if CIRCUITPY_OS_GETENV - mp_obj_t ble_name = common_hal_os_environ_get_key("CIRCUITPY_BLE_NAME"); + mp_obj_t ble_name = common_hal_os_getenv("CIRCUITPY_BLE_NAME", mp_const_none); if (ble_name != mp_const_none) { common_hal_bleio_adapter_set_name(self, mp_obj_str_get_str(ble_name)); return; From fa96bcce84b0ac6feb34b49d55c05362ea7269d4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 8 Dec 2022 20:18:20 -0500 Subject: [PATCH 259/357] remove micropython asyncio doc; update libraries page and links --- docs/drivers.rst | 33 ---- docs/index.rst | 2 +- docs/libraries.rst | 31 ++++ docs/library/asyncio.rst | 323 --------------------------------------- docs/library/index.rst | 1 - 5 files changed, 32 insertions(+), 358 deletions(-) delete mode 100644 docs/drivers.rst create mode 100644 docs/libraries.rst delete mode 100644 docs/library/asyncio.rst diff --git a/docs/drivers.rst b/docs/drivers.rst deleted file mode 100644 index 8855abbd2d..0000000000 --- a/docs/drivers.rst +++ /dev/null @@ -1,33 +0,0 @@ -Additional CircuitPython Libraries and Drivers on GitHub -========================================================= - -These are libraries and drivers available in separate GitHub repos. They are -designed for use with CircuitPython and may or may not work with -`MicroPython `_. - - -Adafruit CircuitPython Library Bundle --------------------------------------- - -We provide a bundle of all our libraries to ease installation of drivers and -their dependencies. The bundle is primarily geared to the Adafruit Express line -of boards which feature a relatively large external flash. With Express boards, -it's easy to copy them all onto the filesystem. However, if you don't have -enough space simply copy things over as they are needed. - -- The Adafruit bundles are available on GitHub: . - -- Documentation for the bundle, which includes links to documentation for all - libraries, is available here: . - - -CircuitPython Community Library Bundle ---------------------------------------- - -This bundle contains non-Adafruit sponsored libraries, that are written and submitted -by members of the community. - -- The Community bundles are available on GitHub: . - -- Documentation is not available on ReadTheDocs at this time. See each library for any - included documentation. diff --git a/docs/index.rst b/docs/index.rst index abc0236995..e49b74b4e3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,7 +21,7 @@ Full Table of Contents ../shared-bindings/index.rst supported_ports.rst troubleshooting.rst - drivers.rst + libraries.rst workflows environment.rst diff --git a/docs/libraries.rst b/docs/libraries.rst new file mode 100644 index 0000000000..2d34ccbe3f --- /dev/null +++ b/docs/libraries.rst @@ -0,0 +1,31 @@ +Adafruit CircuitPython Libraries +================================ + +Documentation for all Adafruit-sponsored CircuitPython libraries is at: +. + + +CircuitPython Library Bundles +============================= + +Many Python libraries, including device drivers, have been written for use with CircuitPython. +They are maintained in separate GitHub repos, one per library. + +Libraries are packaged in *bundles*, which are ZIP files that are snapshots in time of a group of libraries. + +Adafruit sponsors and maintains several hundred libraries, packaged in the **Adafruit Library Bundle**. +Adafruit-sponsored libraries are also available on . + +Yet other libraries are maintained by members of the CircuitPython community, +and are packaged in the **CircuitPython Community Library Bundle**. + +The Adafruit bundles are available on GitHub: . +The Community bundles are available at: . + +More detailed information about the bundles, and download links for the latest bundles +are at . + +Documentation about bundle construction is at: . + +Documentation for Community Libraries is not available on ReadTheDocs at this time. See the GitHub repository +for each library for any included documentation. diff --git a/docs/library/asyncio.rst b/docs/library/asyncio.rst deleted file mode 100644 index 87417f55e2..0000000000 --- a/docs/library/asyncio.rst +++ /dev/null @@ -1,323 +0,0 @@ -:mod:`uasyncio` --- asynchronous I/O scheduler -============================================== - -.. module:: uasyncio - :synopsis: asynchronous I/O scheduler for writing concurrent code - -|see_cpython_module| -`asyncio `_ - -Example:: - - import uasyncio - - async def blink(led, period_ms): - while True: - led.on() - await uasyncio.sleep_ms(5) - led.off() - await uasyncio.sleep_ms(period_ms) - - async def main(led1, led2): - uasyncio.create_task(blink(led1, 700)) - uasyncio.create_task(blink(led2, 400)) - await uasyncio.sleep_ms(10_000) - - # Running on a pyboard - from pyb import LED - uasyncio.run(main(LED(1), LED(2))) - - # Running on a generic board - from machine import Pin - uasyncio.run(main(Pin(1), Pin(2))) - -Core functions --------------- - -.. function:: create_task(coro) - - Create a new task from the given coroutine and schedule it to run. - - Returns the corresponding `Task` object. - -.. function:: current_task() - - Return the `Task` object associated with the currently running task. - -.. function:: run(coro) - - Create a new task from the given coroutine and run it until it completes. - - Returns the value returned by *coro*. - -.. function:: sleep(t) - - Sleep for *t* seconds (can be a float). - - This is a coroutine. - -.. function:: sleep_ms(t) - - Sleep for *t* milliseconds. - - This is a coroutine, and a MicroPython extension. - -Additional functions --------------------- - -.. function:: wait_for(awaitable, timeout) - - Wait for the *awaitable* to complete, but cancel it if it takes longer - that *timeout* seconds. If *awaitable* is not a task then a task will be - created from it. - - If a timeout occurs, it cancels the task and raises ``asyncio.TimeoutError``: - this should be trapped by the caller. - - Returns the return value of *awaitable*. - - This is a coroutine. - -.. function:: wait_for_ms(awaitable, timeout) - - Similar to `wait_for` but *timeout* is an integer in milliseconds. - - This is a coroutine, and a MicroPython extension. - -.. function:: gather(*awaitables, return_exceptions=False) - - Run all *awaitables* concurrently. Any *awaitables* that are not tasks are - promoted to tasks. - - Returns a list of return values of all *awaitables*. - - This is a coroutine. - -class Task ----------- - -.. class:: Task() - - This object wraps a coroutine into a running task. Tasks can be waited on - using ``await task``, which will wait for the task to complete and return - the return value of the task. - - Tasks should not be created directly, rather use `create_task` to create them. - -.. method:: Task.cancel() - - Cancel the task by injecting a ``CancelledError`` into it. The task may - or may not ignore this exception. - -class Event ------------ - -.. class:: Event() - - Create a new event which can be used to synchronise tasks. Events start - in the cleared state. - -.. method:: Event.is_set() - - Returns ``True`` if the event is set, ``False`` otherwise. - -.. method:: Event.set() - - Set the event. Any tasks waiting on the event will be scheduled to run. - -.. method:: Event.clear() - - Clear the event. - -.. method:: Event.wait() - - Wait for the event to be set. If the event is already set then it returns - immediately. - - This is a coroutine. - -class Lock ----------- - -.. class:: Lock() - - Create a new lock which can be used to coordinate tasks. Locks start in - the unlocked state. - - In addition to the methods below, locks can be used in an ``async with`` statement. - -.. method:: Lock.locked() - - Returns ``True`` if the lock is locked, otherwise ``False``. - -.. method:: Lock.acquire() - - Wait for the lock to be in the unlocked state and then lock it in an atomic - way. Only one task can acquire the lock at any one time. - - This is a coroutine. - -.. method:: Lock.release() - - Release the lock. If any tasks are waiting on the lock then the next one in the - queue is scheduled to run and the lock remains locked. Otherwise, no tasks are - waiting an the lock becomes unlocked. - -TCP stream connections ----------------------- - -.. function:: open_connection(host, port) - - Open a TCP connection to the given *host* and *port*. The *host* address will be - resolved using `socket.getaddrinfo`, which is currently a blocking call. - - Returns a pair of streams: a reader and a writer stream. - Will raise a socket-specific ``OSError`` if the host could not be resolved or if - the connection could not be made. - - This is a coroutine. - -.. function:: start_server(callback, host, port, backlog=5) - - Start a TCP server on the given *host* and *port*. The *callback* will be - called with incoming, accepted connections, and be passed 2 arguments: reader - and writer streams for the connection. - - Returns a `Server` object. - - This is a coroutine. - -.. class:: Stream() - - This represents a TCP stream connection. To minimise code this class implements - both a reader and a writer, and both ``StreamReader`` and ``StreamWriter`` alias to - this class. - -.. method:: Stream.get_extra_info(v) - - Get extra information about the stream, given by *v*. The valid values for *v* are: - ``peername``. - -.. method:: Stream.close() - - Close the stream. - -.. method:: Stream.wait_closed() - - Wait for the stream to close. - - This is a coroutine. - -.. method:: Stream.read(n) - - Read up to *n* bytes and return them. - - This is a coroutine. - -.. method:: Stream.readinto(buf) - - Read up to n bytes into *buf* with n being equal to the length of *buf*. - - Return the number of bytes read into *buf*. - - This is a coroutine, and a MicroPython extension. - -.. method:: Stream.readexactly(n) - - Read exactly *n* bytes and return them as a bytes object. - - Raises an ``EOFError`` exception if the stream ends before reading *n* bytes. - - This is a coroutine. - -.. method:: Stream.readline() - - Read a line and return it. - - This is a coroutine. - -.. method:: Stream.write(buf) - - Accumulated *buf* to the output buffer. The data is only flushed when - `Stream.drain` is called. It is recommended to call `Stream.drain` immediately - after calling this function. - -.. method:: Stream.drain() - - Drain (write) all buffered output data out to the stream. - - This is a coroutine. - -.. class:: Server() - - This represents the server class returned from `start_server`. It can be used - in an ``async with`` statement to close the server upon exit. - -.. method:: Server.close() - - Close the server. - -.. method:: Server.wait_closed() - - Wait for the server to close. - - This is a coroutine. - -Event Loop ----------- - -.. function:: get_event_loop() - - Return the event loop used to schedule and run tasks. See `Loop`. - -.. function:: new_event_loop() - - Reset the event loop and return it. - - Note: since MicroPython only has a single event loop this function just - resets the loop's state, it does not create a new one. - -.. class:: Loop() - - This represents the object which schedules and runs tasks. It cannot be - created, use `get_event_loop` instead. - -.. method:: Loop.create_task(coro) - - Create a task from the given *coro* and return the new `Task` object. - -.. method:: Loop.run_forever() - - Run the event loop until `stop()` is called. - -.. method:: Loop.run_until_complete(awaitable) - - Run the given *awaitable* until it completes. If *awaitable* is not a task - then it will be promoted to one. - -.. method:: Loop.stop() - - Stop the event loop. - -.. method:: Loop.close() - - Close the event loop. - -.. method:: Loop.set_exception_handler(handler) - - Set the exception handler to call when a Task raises an exception that is not - caught. The *handler* should accept two arguments: ``(loop, context)``. - -.. method:: Loop.get_exception_handler() - - Get the current exception handler. Returns the handler, or ``None`` if no - custom handler is set. - -.. method:: Loop.default_exception_handler(context) - - The default exception handler that is called. - -.. method:: Loop.call_exception_handler(context) - - Call the current exception handler. The argument *context* is passed through and - is a dictionary containing keys: ``'message'``, ``'exception'``, ``'future'``. diff --git a/docs/library/index.rst b/docs/library/index.rst index b71949c2dd..2a8e37a8f4 100644 --- a/docs/library/index.rst +++ b/docs/library/index.rst @@ -35,7 +35,6 @@ These libraries are not currently enabled in any CircuitPython build, but may be json.rst re.rst sys.rst - asyncio.rst ctypes.rst select.rst From 529ec23ecba3718a75ead98e0f43083e7b579f2c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Dec 2022 20:07:48 -0600 Subject: [PATCH 260/357] sadly, no emoji in the docs :( hopefully this works --- docs/environment.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/environment.rst b/docs/environment.rst index 0a370d64d9..1d4057b609 100644 --- a/docs/environment.rst +++ b/docs/environment.rst @@ -26,8 +26,9 @@ File format example: str_key="Hello world" # with trailing comment int_key = 7 - unicode_key="👨" - unicode_key2="\\U0001f468" # same as above + unicode_key="œuvre" + unicode_key2="\\u0153uvre" # same as above + unicode_key3="\\U00000153uvre" # same as above escape_codes="supported, including \\r\\n\\"\\\\" # comment [subtable] From 3a92c079fcc42c2ffe49963ddfb0312557acae6c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:07:23 -0600 Subject: [PATCH 261/357] Finish renaming os_environ_get_key to os_getenv .. for consistency. --- ports/espressif/common-hal/_bleio/Adapter.c | 2 +- ports/espressif/supervisor/port.c | 2 +- shared-module/os/__init__.h | 2 +- shared-module/os/getenv.c | 2 +- supervisor/shared/web_workflow/web_workflow.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index 7da1cd0b8c..414ef8b09c 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -103,7 +103,7 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable #if CIRCUITPY_OS_GETENV char ble_name[1 + MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH]; - os_environ_err_t result = common_hal_os_environ_get_key_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name)); + os_environ_err_t result = common_hal_os_getenv_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name)); if (result == ENVIRON_OK) { ble_svc_gap_device_name_set(ble_name); } else diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 2792792455..546477cbf2 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -519,7 +519,7 @@ void port_idle_until_interrupt(void) { void port_post_boot_py(bool heap_valid) { if (!heap_valid && filesystem_present()) { mp_int_t reserved; - if (common_hal_os_environ_get_key_int("CIRCUITPY_RESERVED_PSRAM", &reserved) == ENVIRON_OK) { + if (common_hal_os_getenv_int("CIRCUITPY_RESERVED_PSRAM", &reserved) == ENVIRON_OK) { common_hal_espidf_set_reserved_psram(reserved); } common_hal_espidf_reserve_psram(); diff --git a/shared-module/os/__init__.h b/shared-module/os/__init__.h index 48bd06195e..7c32cdcd95 100644 --- a/shared-module/os/__init__.h +++ b/shared-module/os/__init__.h @@ -38,7 +38,7 @@ typedef enum { // Allocation free version that returns the full length of the value. // If it fits, the return value is 0-terminated. If the value doesn't fit, // *value_len may be an over-estimate but never an under-estimate. -os_environ_err_t common_hal_os_environ_get_key_str(const char *key, char *value, size_t value_len); +os_environ_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len); // Returns ENVIRON_ERR_OK and sets value to the read value. Returns // ENVIRON_ERR_... if the value was not numeric. allocation-free. diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index ec9edbacac..2b610bd91c 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -323,7 +323,7 @@ STATIC os_environ_err_t os_environ_get_key_buf_terminated(const char *key, char return result; } -os_environ_err_t common_hal_os_environ_get_key_str(const char *key, char *value, size_t value_len) { +os_environ_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len) { bool quoted; os_environ_err_t result = os_environ_get_key_buf_terminated(key, value, value_len, "ed); if (result == ENVIRON_OK && !quoted) { diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index ab9ded66a3..525b851b8f 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -251,7 +251,7 @@ void supervisor_start_web_workflow(void) { size_t ssid_len = 0; size_t password_len = 0; - os_environ_err_t result = common_hal_os_environ_get_key_str("CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid)); + os_environ_err_t result = common_hal_os_getenv_str("CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid)); if (result != ENVIRON_OK) { return; } From f2032dbf0f47cbc56e3688b361615e3cebf1d31b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:11:37 -0600 Subject: [PATCH 262/357] remove mention of _environ --- docs/environment.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/environment.rst b/docs/environment.rst index 1d4057b609..58ada402c6 100644 --- a/docs/environment.rst +++ b/docs/environment.rst @@ -32,7 +32,7 @@ File format example: escape_codes="supported, including \\r\\n\\"\\\\" # comment [subtable] - subvalue="cannot retrieve this using _environ or getenv" + subvalue="cannot retrieve this using getenv" Details of the toml language subset From 499af3ed000819cac89930a36c0499e92fd837d1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:11:57 -0600 Subject: [PATCH 263/357] update source locations in translation file --- locale/circuitpython.pot | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 43c7a79ff7..56c2396d46 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1002,7 +1002,7 @@ msgstr "" msgid "File exists" msgstr "" -#: shared-module/_environ/__init__.c +#: shared-module/os/getenv.c msgid "File not found" msgstr "" @@ -1190,7 +1190,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c -#: shared-module/_environ/__init__.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1237,7 +1237,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: shared-module/_environ/__init__.c +#: shared-module/os/getenv.c #, c-format msgid "Invalid byte %.*s" msgstr "" @@ -1272,7 +1272,7 @@ msgstr "" msgid "Invalid state" msgstr "" -#: shared-module/_environ/__init__.c +#: shared-module/os/getenv.c msgid "Invalid unicode escape" msgstr "" @@ -1280,7 +1280,7 @@ msgstr "" msgid "Key must be 16, 24, or 32 bytes long" msgstr "" -#: shared-module/_environ/__init__.c +#: shared-module/os/getenv.c msgid "Key not found" msgstr "" From 678a466d1af3a6d1bcec01525af12e87182e475e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:12:27 -0600 Subject: [PATCH 264/357] alphabetize --- ports/atmel-samd/mpconfigport.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 72b1302227..57f7ca339f 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -24,16 +24,15 @@ ifeq ($(CHIP_FAMILY),samd21) CIRCUITPY_AESIO ?= 0 CIRCUITPY_ATEXIT ?= 0 CIRCUITPY_AUDIOMIXER ?= 0 +CIRCUITPY_AUDIOMP3 ?= 0 CIRCUITPY_BINASCII ?= 0 CIRCUITPY_BITBANGIO ?= 0 CIRCUITPY_BITMAPTOOLS ?= 0 -CIRCUITPY_BUSDEVICE ?= 0 -CIRCUITPY_AUDIOMP3 ?= 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_BUILTINS_POW3 ?= 0 +CIRCUITPY_BUSDEVICE ?= 0 CIRCUITPY_COMPUTED_GOTO_SAVE_SPACE ?= 1 CIRCUITPY_COUNTIO ?= 0 -CIRCUITPY_OS_GETENV ?= 0 # Not enough RAM for framebuffers CIRCUITPY_FRAMEBUFFERIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 @@ -43,6 +42,7 @@ CIRCUITPY_I2CTARGET ?= 0 CIRCUITPY_JSON ?= 0 CIRCUITPY_KEYPAD ?= 0 CIRCUITPY_MSGPACK ?= 0 +CIRCUITPY_OS_GETENV ?= 0 CIRCUITPY_PIXELMAP ?= 0 CIRCUITPY_RE ?= 0 CIRCUITPY_SDCARDIO ?= 0 From 44f15d563dfea31606dc03fb5905c8b91615458f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:14:53 -0600 Subject: [PATCH 265/357] Rename "environ" errors to "getenv" errors --- ports/espressif/common-hal/_bleio/Adapter.c | 4 +-- ports/espressif/supervisor/port.c | 2 +- shared-module/os/__init__.h | 8 ++--- shared-module/os/getenv.c | 30 +++++++++---------- supervisor/shared/web_workflow/web_workflow.c | 4 +-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index 414ef8b09c..3239c501cc 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -103,8 +103,8 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable #if CIRCUITPY_OS_GETENV char ble_name[1 + MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH]; - os_environ_err_t result = common_hal_os_getenv_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name)); - if (result == ENVIRON_OK) { + os_getenv_err_t result = common_hal_os_getenv_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name)); + if (result == GETENV_OK) { ble_svc_gap_device_name_set(ble_name); } else #endif diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 546477cbf2..baeba5ce90 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -519,7 +519,7 @@ void port_idle_until_interrupt(void) { void port_post_boot_py(bool heap_valid) { if (!heap_valid && filesystem_present()) { mp_int_t reserved; - if (common_hal_os_getenv_int("CIRCUITPY_RESERVED_PSRAM", &reserved) == ENVIRON_OK) { + if (common_hal_os_getenv_int("CIRCUITPY_RESERVED_PSRAM", &reserved) == GETENV_OK) { common_hal_espidf_set_reserved_psram(reserved); } common_hal_espidf_reserve_psram(); diff --git a/shared-module/os/__init__.h b/shared-module/os/__init__.h index 7c32cdcd95..ce7199c8f2 100644 --- a/shared-module/os/__init__.h +++ b/shared-module/os/__init__.h @@ -27,19 +27,19 @@ #pragma once typedef enum { - ENVIRON_OK = 0, + GETENV_OK = 0, ENVIRON_ERR_OPEN, ENVIRON_ERR_UNICODE, ENVIRON_ERR_LENGTH, ENVIRON_ERR_NOT_FOUND, ENVIRON_ERR_UNEXPECTED = 0xff00, // logical or'd with the byte value -} os_environ_err_t; +} os_getenv_err_t; // Allocation free version that returns the full length of the value. // If it fits, the return value is 0-terminated. If the value doesn't fit, // *value_len may be an over-estimate but never an under-estimate. -os_environ_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len); +os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len); // Returns ENVIRON_ERR_OK and sets value to the read value. Returns // ENVIRON_ERR_... if the value was not numeric. allocation-free. -os_environ_err_t common_hal_os_environ_get_key_int(const char *key, mp_int_t *value); +os_getenv_err_t common_hal_os_environ_get_key_int(const char *key, mp_int_t *value); diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index 2b610bd91c..b883ae423c 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -39,7 +39,7 @@ #include "supervisor/filesystem.h" #include "supervisor/memory.h" -#define ENVIRON_PATH "settings.toml" +#define GETENV_PATH "settings.toml" #if defined(UNIX) typedef FILE *file_arg; @@ -178,7 +178,7 @@ STATIC bool key_matches(file_arg *active_file, const char *key) { return true; } -STATIC os_environ_err_t read_unicode_escape(file_arg *active_file, int sz, vstr_t *buf) { +STATIC os_getenv_err_t read_unicode_escape(file_arg *active_file, int sz, vstr_t *buf) { char hex_buf[sz + 1]; for (int i = 0; i < sz; i++) { hex_buf[i] = get_next_byte(active_file); @@ -197,7 +197,7 @@ STATIC os_environ_err_t read_unicode_escape(file_arg *active_file, int sz, vstr_ } // Read a quoted string -STATIC os_environ_err_t read_string_value(file_arg *active_file, vstr_t *buf) { +STATIC os_getenv_err_t read_string_value(file_arg *active_file, vstr_t *buf) { while (true) { int character = get_next_byte(active_file); switch (character) { @@ -244,7 +244,7 @@ STATIC os_environ_err_t read_string_value(file_arg *active_file, vstr_t *buf) { case 'U': case 'u': { int sz = (character == 'u') ? 4 : 8; - os_environ_err_t res; + os_getenv_err_t res; res = read_unicode_escape(active_file, sz, buf); if (res != ENVIRON_OK) { return res; @@ -262,7 +262,7 @@ STATIC os_environ_err_t read_string_value(file_arg *active_file, vstr_t *buf) { } // Read a numeric value (non-quoted value) as a string -STATIC os_environ_err_t read_bare_value(file_arg *active_file, vstr_t *buf, int first_character) { +STATIC os_getenv_err_t read_bare_value(file_arg *active_file, vstr_t *buf, int first_character) { int character = first_character; while (true) { switch (character) { @@ -292,13 +292,13 @@ STATIC mp_int_t read_value(file_arg *active_file, vstr_t *buf, bool *quoted) { } } -STATIC os_environ_err_t os_environ_get_key_vstr(const char *path, const char *key, vstr_t *buf, bool *quoted) { +STATIC os_getenv_err_t os_environ_get_key_vstr(const char *path, const char *key, vstr_t *buf, bool *quoted) { file_arg active_file; if (!open_file(path, &active_file)) { return ENVIRON_ERR_OPEN; } - os_environ_err_t result = ENVIRON_ERR_NOT_FOUND; + os_getenv_err_t result = ENVIRON_ERR_NOT_FOUND; while (!is_eof(&active_file)) { if (key_matches(&active_file, key)) { result = read_value(&active_file, buf, quoted); @@ -308,10 +308,10 @@ STATIC os_environ_err_t os_environ_get_key_vstr(const char *path, const char *ke return result; } -STATIC os_environ_err_t os_environ_get_key_buf_terminated(const char *key, char *value, size_t value_len, bool *quoted) { +STATIC os_getenv_err_t os_environ_get_key_buf_terminated(const char *key, char *value, size_t value_len, bool *quoted) { vstr_t buf; vstr_init_fixed_buf(&buf, value_len, value); - os_environ_err_t result = os_environ_get_key_vstr(ENVIRON_PATH, key, &buf, quoted); + os_getenv_err_t result = os_environ_get_key_vstr(ENVIRON_PATH, key, &buf, quoted); if (result == ENVIRON_OK) { vstr_add_byte_nonstd(&buf, 0); @@ -323,16 +323,16 @@ STATIC os_environ_err_t os_environ_get_key_buf_terminated(const char *key, char return result; } -os_environ_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len) { +os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len) { bool quoted; - os_environ_err_t result = os_environ_get_key_buf_terminated(key, value, value_len, "ed); + os_getenv_err_t result = os_environ_get_key_buf_terminated(key, value, value_len, "ed); if (result == ENVIRON_OK && !quoted) { result = ENVIRON_ERR_UNEXPECTED | value[0]; } return result; } -STATIC void throw__environ_error(os_environ_err_t error) { +STATIC void throw__environ_error(os_getenv_err_t error) { if (error == ENVIRON_OK) { return; } @@ -366,7 +366,7 @@ mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t d bool quoted; vstr_init(&buf, 64); - os_environ_err_t result = os_environ_get_key_vstr(path, key, &buf, "ed); + os_getenv_err_t result = os_environ_get_key_vstr(path, key, &buf, "ed); if (result == ENVIRON_ERR_NOT_FOUND) { return default_; } @@ -383,10 +383,10 @@ mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_) { return common_hal_os_getenv_path(ENVIRON_PATH, key, default_); } -os_environ_err_t common_hal_os_environ_get_key_int(const char *key, mp_int_t *value) { +os_getenv_err_t common_hal_os_environ_get_key_int(const char *key, mp_int_t *value) { char buf[16]; bool quoted; - os_environ_err_t result = os_environ_get_key_buf_terminated(key, buf, sizeof(buf), "ed); + os_getenv_err_t result = os_environ_get_key_buf_terminated(key, buf, sizeof(buf), "ed); if (result != ENVIRON_OK) { return result; } diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 525b851b8f..5bac8522dd 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -251,8 +251,8 @@ void supervisor_start_web_workflow(void) { size_t ssid_len = 0; size_t password_len = 0; - os_environ_err_t result = common_hal_os_getenv_str("CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid)); - if (result != ENVIRON_OK) { + os_getenv_err_t result = common_hal_os_getenv_str("CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid)); + if (result != GETENV_OK) { return; } From 1f504e5c0f65d88212aa32f1b1cb4c9403d23a81 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:15:00 -0600 Subject: [PATCH 266/357] Remove line accidentally duplicated --- ports/unix/coverage.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index 8463c169e4..0e4c6dbd48 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -95,7 +95,6 @@ STATIC const mp_rom_map_elem_t rawfile_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj) }, { MP_ROM_QSTR(MP_QSTR_ioctl), MP_ROM_PTR(&mp_stream_ioctl_obj) }, - { MP_ROM_QSTR(MP_QSTR_ioctl), MP_ROM_PTR(&mp_stream_ioctl_obj) }, }; STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict, rawfile_locals_dict_table); From cc7d550407adf39c036ddd4ade38d1a35b990ebe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:28:46 -0600 Subject: [PATCH 267/357] Really finish renaming to getenv --- py/circuitpy_defns.mk | 1 - shared-module/os/__init__.h | 21 ++++++----- shared-module/os/getenv.c | 74 ++++++++++++++++++------------------- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index df3f664864..2deefda030 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -586,7 +586,6 @@ SRC_SHARED_MODULE_ALL = \ displayio/TileGrid.c \ displayio/area.c \ displayio/__init__.c \ - _environ/__init__.c \ floppyio/__init__.c \ fontio/BuiltinFont.c \ fontio/__init__.c \ diff --git a/shared-module/os/__init__.h b/shared-module/os/__init__.h index ce7199c8f2..0e1d78c53b 100644 --- a/shared-module/os/__init__.h +++ b/shared-module/os/__init__.h @@ -28,18 +28,19 @@ typedef enum { GETENV_OK = 0, - ENVIRON_ERR_OPEN, - ENVIRON_ERR_UNICODE, - ENVIRON_ERR_LENGTH, - ENVIRON_ERR_NOT_FOUND, - ENVIRON_ERR_UNEXPECTED = 0xff00, // logical or'd with the byte value + GETENV_ERR_OPEN, + GETENV_ERR_UNICODE, + GETENV_ERR_LENGTH, + GETENV_ERR_NOT_FOUND, + GETENV_ERR_UNEXPECTED = 0xff00, // logical or'd with the byte value } os_getenv_err_t; // Allocation free version that returns the full length of the value. -// If it fits, the return value is 0-terminated. If the value doesn't fit, -// *value_len may be an over-estimate but never an under-estimate. +// If it fits, the return value is 0-terminated. The passed in buffer +// may be modified even if an error is returned. Allocation free. os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len); -// Returns ENVIRON_ERR_OK and sets value to the read value. Returns -// ENVIRON_ERR_... if the value was not numeric. allocation-free. -os_getenv_err_t common_hal_os_environ_get_key_int(const char *key, mp_int_t *value); +// Returns GETENV_OK and sets value to the read value. Returns +// GETENV_ERR_... if the value was not numeric. allocation-free. +// If any error code is returned, value is guaranteed not modified +os_getenv_err_t common_hal_os_getenv_int(const char *key, mp_int_t *value); diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index b883ae423c..dc1f640aec 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -187,13 +187,13 @@ STATIC os_getenv_err_t read_unicode_escape(file_arg *active_file, int sz, vstr_t char *end; unsigned long c = strtoul(hex_buf, &end, 16); if (end != &hex_buf[sz]) { - return ENVIRON_ERR_UNEXPECTED | *end; + return GETENV_ERR_UNEXPECTED | *end; } if (c >= 0x110000) { - return ENVIRON_ERR_UNICODE; + return GETENV_ERR_UNICODE; } vstr_add_char_nonstd(buf, c); - return ENVIRON_OK; + return GETENV_OK; } // Read a quoted string @@ -203,7 +203,7 @@ STATIC os_getenv_err_t read_string_value(file_arg *active_file, vstr_t *buf) { switch (character) { case 0: case '\n': - return ENVIRON_ERR_UNEXPECTED | character; + return GETENV_ERR_UNEXPECTED | character; case '"': character = consume_whitespace(active_file); @@ -212,9 +212,9 @@ STATIC os_getenv_err_t read_string_value(file_arg *active_file, vstr_t *buf) { next_line(active_file); MP_FALLTHROUGH; case '\n': - return ENVIRON_OK; + return GETENV_OK; default: - return ENVIRON_ERR_UNEXPECTED | character; + return GETENV_ERR_UNEXPECTED | character; } case '\\': @@ -222,7 +222,7 @@ STATIC os_getenv_err_t read_string_value(file_arg *active_file, vstr_t *buf) { switch (character) { case 0: case '\n': - return ENVIRON_ERR_UNEXPECTED | character; + return GETENV_ERR_UNEXPECTED | character; case 'b': character = '\b'; break; @@ -246,7 +246,7 @@ STATIC os_getenv_err_t read_string_value(file_arg *active_file, vstr_t *buf) { int sz = (character == 'u') ? 4 : 8; os_getenv_err_t res; res = read_unicode_escape(active_file, sz, buf); - if (res != ENVIRON_OK) { + if (res != GETENV_OK) { return res; } continue; @@ -267,12 +267,12 @@ STATIC os_getenv_err_t read_bare_value(file_arg *active_file, vstr_t *buf, int f while (true) { switch (character) { case 0: - return ENVIRON_ERR_UNEXPECTED | character; + return GETENV_ERR_UNEXPECTED | character; case '\n': - return ENVIRON_OK; + return GETENV_OK; case '#': next_line(active_file); - return ENVIRON_OK; + return GETENV_OK; default: vstr_add_byte_nonstd(buf, character); } @@ -292,13 +292,13 @@ STATIC mp_int_t read_value(file_arg *active_file, vstr_t *buf, bool *quoted) { } } -STATIC os_getenv_err_t os_environ_get_key_vstr(const char *path, const char *key, vstr_t *buf, bool *quoted) { +STATIC os_getenv_err_t os_getenv_vstr(const char *path, const char *key, vstr_t *buf, bool *quoted) { file_arg active_file; if (!open_file(path, &active_file)) { - return ENVIRON_ERR_OPEN; + return GETENV_ERR_OPEN; } - os_getenv_err_t result = ENVIRON_ERR_NOT_FOUND; + os_getenv_err_t result = GETENV_ERR_NOT_FOUND; while (!is_eof(&active_file)) { if (key_matches(&active_file, key)) { result = read_value(&active_file, buf, quoted); @@ -308,16 +308,16 @@ STATIC os_getenv_err_t os_environ_get_key_vstr(const char *path, const char *key return result; } -STATIC os_getenv_err_t os_environ_get_key_buf_terminated(const char *key, char *value, size_t value_len, bool *quoted) { +STATIC os_getenv_err_t os_getenv_buf_terminated(const char *key, char *value, size_t value_len, bool *quoted) { vstr_t buf; vstr_init_fixed_buf(&buf, value_len, value); - os_getenv_err_t result = os_environ_get_key_vstr(ENVIRON_PATH, key, &buf, quoted); + os_getenv_err_t result = os_getenv_vstr(GETENV_PATH, key, &buf, quoted); - if (result == ENVIRON_OK) { + if (result == GETENV_OK) { vstr_add_byte_nonstd(&buf, 0); memcpy(value, buf.buf, MIN(buf.len, value_len)); if (buf.len > value_len) { - result = ENVIRON_ERR_LENGTH; + result = GETENV_ERR_LENGTH; } } return result; @@ -325,18 +325,18 @@ STATIC os_getenv_err_t os_environ_get_key_buf_terminated(const char *key, char * os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len) { bool quoted; - os_getenv_err_t result = os_environ_get_key_buf_terminated(key, value, value_len, "ed); - if (result == ENVIRON_OK && !quoted) { - result = ENVIRON_ERR_UNEXPECTED | value[0]; + os_getenv_err_t result = os_getenv_buf_terminated(key, value, value_len, "ed); + if (result == GETENV_OK && !quoted) { + result = GETENV_ERR_UNEXPECTED | value[0]; } return result; } -STATIC void throw__environ_error(os_getenv_err_t error) { - if (error == ENVIRON_OK) { +STATIC void throw_getenv_error(os_getenv_err_t error) { + if (error == GETENV_OK) { return; } - if (error & ENVIRON_ERR_UNEXPECTED) { + if (error & GETENV_ERR_UNEXPECTED) { byte character = (error & 0xff); mp_print_t print; vstr_t vstr; @@ -350,11 +350,11 @@ STATIC void throw__environ_error(os_getenv_err_t error) { vstr.len, vstr.buf); } switch (error) { - case ENVIRON_ERR_OPEN: + case GETENV_ERR_OPEN: mp_raise_ValueError(translate("File not found")); - case ENVIRON_ERR_UNICODE: + case GETENV_ERR_UNICODE: mp_raise_ValueError(translate("Invalid unicode escape")); - case ENVIRON_ERR_NOT_FOUND: + case GETENV_ERR_NOT_FOUND: mp_raise_ValueError(translate("Key not found")); default: mp_raise_RuntimeError(translate("Internal error")); @@ -366,11 +366,11 @@ mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t d bool quoted; vstr_init(&buf, 64); - os_getenv_err_t result = os_environ_get_key_vstr(path, key, &buf, "ed); - if (result == ENVIRON_ERR_NOT_FOUND) { + os_getenv_err_t result = os_getenv_vstr(path, key, &buf, "ed); + if (result == GETENV_ERR_NOT_FOUND) { return default_; } - throw__environ_error(result); + throw_getenv_error(result); if (quoted) { return mp_obj_new_str_from_vstr(&mp_type_str, &buf); @@ -380,24 +380,24 @@ mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t d } mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_) { - return common_hal_os_getenv_path(ENVIRON_PATH, key, default_); + return common_hal_os_getenv_path(GETENV_PATH, key, default_); } -os_getenv_err_t common_hal_os_environ_get_key_int(const char *key, mp_int_t *value) { +os_getenv_err_t common_hal_os_getenv_int(const char *key, mp_int_t *value) { char buf[16]; bool quoted; - os_getenv_err_t result = os_environ_get_key_buf_terminated(key, buf, sizeof(buf), "ed); - if (result != ENVIRON_OK) { + os_getenv_err_t result = os_getenv_buf_terminated(key, buf, sizeof(buf), "ed); + if (result != GETENV_OK) { return result; } if (quoted) { - return ENVIRON_ERR_UNEXPECTED | '"'; + return GETENV_ERR_UNEXPECTED | '"'; } char *end; long num = strtol(buf, &end, 0); if (end == buf || *end) { // If the whole buffer was not consumed it's an error - return ENVIRON_ERR_UNEXPECTED | *end; + return GETENV_ERR_UNEXPECTED | *end; } *value = (mp_int_t)num; - return ENVIRON_OK; + return GETENV_OK; } From 040fac07243fb61a66388d9bac9eb3f2d1c28ee6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:29:14 -0600 Subject: [PATCH 268/357] No need to track excess length .. this is a relic from when the actual required length was given back to the caller --- shared-module/os/getenv.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index dc1f640aec..09dc19748d 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -101,8 +101,6 @@ STATIC void seek_eof(file_arg *active_file) { STATIC void vstr_add_byte_nonstd(vstr_t *vstr, byte b) { if (!vstr->fixed_buf || vstr->alloc > vstr->len) { vstr_add_byte(vstr, b); - } else { - vstr->len++; } } @@ -114,8 +112,6 @@ STATIC void vstr_add_char_nonstd(vstr_t *vstr, unichar c) { (c < 0x10000) ? 3 : 4; if (!vstr->fixed_buf || vstr->alloc > vstr->len + ulen) { vstr_add_char(vstr, c); - } else { - vstr->len += ulen; } } From 6dca9db225c851edb3236e5c613192a48f2a3496 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:35:50 -0600 Subject: [PATCH 269/357] Rename test function & fix a bug with default value handling --- ports/unix/main.c | 8 ++++---- tests/circuitpython/environ_test.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/unix/main.c b/ports/unix/main.c index aa7c92dcff..506a8ed433 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -421,11 +421,11 @@ STATIC void set_sys_argv(char *argv[], int argc, int start_arg) { #endif mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t default_); -STATIC mp_obj_t get_key(mp_obj_t path_in, mp_obj_t key_to_get_in) { +STATIC mp_obj_t getenv_from_file(mp_obj_t path_in, mp_obj_t key_to_get_in) { return common_hal_os_getenv_path(mp_obj_str_get_str(path_in), - mp_obj_str_get_str(key_to_get_in), mp_const_none); + mp_obj_str_get_str(key_to_get_in), default_); } -MP_DEFINE_CONST_FUN_OBJ_2(get_key_obj, get_key); +MP_DEFINE_CONST_FUN_OBJ_2(getenv_from_file_obj, get_key); MP_NOINLINE int main_(int argc, char **argv); @@ -547,7 +547,7 @@ MP_NOINLINE int main_(int argc, char **argv) { MP_DECLARE_CONST_FUN_OBJ_0(extra_cpp_coverage_obj); mp_store_global(MP_QSTR_extra_coverage, MP_OBJ_FROM_PTR(&extra_coverage_obj)); mp_store_global(MP_QSTR_extra_cpp_coverage, MP_OBJ_FROM_PTR(&extra_cpp_coverage_obj)); - mp_store_global(MP_QSTR_get_key, MP_OBJ_FROM_PTR(&get_key_obj)); + mp_store_global(MP_QSTR_getenv_from_file, MP_OBJ_FROM_PTR(&getenv_from_file_obj)); } #endif diff --git a/tests/circuitpython/environ_test.py b/tests/circuitpython/environ_test.py index 8dfab8812c..9781444100 100644 --- a/tests/circuitpython/environ_test.py +++ b/tests/circuitpython/environ_test.py @@ -1,7 +1,7 @@ import os try: - get_key + getenv_from_file except NameError: # Because run-tests.py suppresses site-packages, this test can't be run # on the host interpreter. However, it can be run manually to @@ -10,7 +10,7 @@ except NameError: # After 3.11 becomes standard, change this to use tomllib. import tomlkit - def get_key(filename, key): + def getenv_from_file(filename, key): with open(filename) as f: s = tomlkit.load(f) return s.get(key, None) From 3ab71d7448a5dfb972ab2c2b06121507ed29d5a4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 9 Dec 2022 14:46:06 -0600 Subject: [PATCH 270/357] Rename test function, make 'bad' files binary & add another test --- .gitignore | 1 + .pre-commit-config.yaml | 4 +- ports/unix/main.c | 4 +- tests/circuitpython/bad4.toml | 1 + tests/circuitpython/environ_test.py | 42 ------------------- tests/circuitpython/getenv_test.py | 20 +++++++++ ...environ_test.py.exp => getenv_test.py.exp} | 35 ++++++++-------- 7 files changed, 44 insertions(+), 63 deletions(-) create mode 100644 tests/circuitpython/bad4.toml delete mode 100644 tests/circuitpython/environ_test.py create mode 100644 tests/circuitpython/getenv_test.py rename tests/circuitpython/{environ_test.py.exp => getenv_test.py.exp} (69%) diff --git a/.gitignore b/.gitignore index 2fdfe207a2..9cb1e9ea5e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ !atmel-samd/asf/**/*.a *.elf *.bin +!*.toml.bin *.map *.hex *.dis diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1905b233cf..05e193f0e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,9 +8,9 @@ repos: hooks: - id: check-yaml - id: end-of-file-fixer - exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)' + exclude: '^(tests/.*\.toml|tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)' - id: trailing-whitespace - exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/.*)' + exclude: '^(tests/.*\.toml|tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/.*)' - repo: local hooks: - id: translations diff --git a/ports/unix/main.c b/ports/unix/main.c index 506a8ed433..e423634e58 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -423,9 +423,9 @@ STATIC void set_sys_argv(char *argv[], int argc, int start_arg) { mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t default_); STATIC mp_obj_t getenv_from_file(mp_obj_t path_in, mp_obj_t key_to_get_in) { return common_hal_os_getenv_path(mp_obj_str_get_str(path_in), - mp_obj_str_get_str(key_to_get_in), default_); + mp_obj_str_get_str(key_to_get_in), mp_const_none); } -MP_DEFINE_CONST_FUN_OBJ_2(getenv_from_file_obj, get_key); +MP_DEFINE_CONST_FUN_OBJ_2(getenv_from_file_obj, getenv_from_file); MP_NOINLINE int main_(int argc, char **argv); diff --git a/tests/circuitpython/bad4.toml b/tests/circuitpython/bad4.toml new file mode 100644 index 0000000000..befe224084 --- /dev/null +++ b/tests/circuitpython/bad4.toml @@ -0,0 +1 @@ +string=" \ No newline at end of file diff --git a/tests/circuitpython/environ_test.py b/tests/circuitpython/environ_test.py deleted file mode 100644 index 9781444100..0000000000 --- a/tests/circuitpython/environ_test.py +++ /dev/null @@ -1,42 +0,0 @@ -import os - -try: - getenv_from_file -except NameError: - # Because run-tests.py suppresses site-packages, this test can't be run - # on the host interpreter. However, it can be run manually to - # generate/update the expected file. - # - # After 3.11 becomes standard, change this to use tomllib. - import tomlkit - - def getenv_from_file(filename, key): - with open(filename) as f: - s = tomlkit.load(f) - return s.get(key, None) - - -def run_test(f, k=None): - try: - v = get_key(f"{BASE}/{f}.toml", k or f) - print(f, k, repr(v)) - except Exception as e: - print(f, k, "err") - - -if "/" in __file__: - BASE = __file__.rsplit("/", 1)[0] -else: - BASE = "." - -run_test("good", "notpresent") -run_test("good", "string") -run_test("good", "number") -run_test("good", "cstring") -run_test("good", "cnumber") -run_test("good", "subvalue") -for i in range(8): - run_test("good", f"string{i}") -run_test("bad1", "string") -run_test("bad2", "string") -run_test("bad3", "string") diff --git a/tests/circuitpython/getenv_test.py b/tests/circuitpython/getenv_test.py new file mode 100644 index 0000000000..d3735cc260 --- /dev/null +++ b/tests/circuitpython/getenv_test.py @@ -0,0 +1,20 @@ +def run_test(f, k=None): + try: + v = getenv_from_file(f"{BASE}/{f}.toml", k or f) + print(f, k, repr(v)) + except Exception as e: + print(f, k, str(e)) + + +BASE = __file__.rpartition("/")[0] or "." + +run_test("good", "notpresent") +run_test("good", "string") +run_test("good", "number") +run_test("good", "cstring") +run_test("good", "cnumber") +run_test("good", "subvalue") +for i in range(8): + run_test("good", f"string{i}") +for i in range(1, 5): + run_test(f"bad{i}", f"string") diff --git a/tests/circuitpython/environ_test.py.exp b/tests/circuitpython/getenv_test.py.exp similarity index 69% rename from tests/circuitpython/environ_test.py.exp rename to tests/circuitpython/getenv_test.py.exp index f168b089c0..e7c58666c2 100644 --- a/tests/circuitpython/environ_test.py.exp +++ b/tests/circuitpython/getenv_test.py.exp @@ -1,17 +1,18 @@ -good notpresent None -good string 'hello world' -good number 7 -good cstring 'hello comment' -good cnumber 127 -good subvalue None -good string0 None -good string1 '\n' -good string2 'Áx' -good string3 'Áx' -good string4 '\x0c"\\' -good string5 '\t\r\x08' -good string6 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' -good string7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' -bad1 string err -bad2 string err -bad3 string err +good.toml notpresent None +good.toml string 'hello world' +good.toml number 7 +good.toml cstring 'hello comment' +good.toml cnumber 127 +good.toml subvalue None +good.toml string0 None +good.toml string1 '\n' +good.toml string2 'Áx' +good.toml string3 'Áx' +good.toml string4 '\x0c"\\' +good.toml string5 '\t\r\x08' +good.toml string6 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +good.toml string7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +bad1.toml.bin string Invalid byte '\n' +bad2.toml.bin string Invalid byte '"' +bad3.toml.bin string invalid syntax for integer with base 10: '' +bad4.toml.bin string Invalid byte 'EOF' From dd6dd5df21a3c7a83f7c5eaa24ff7cfe6ceb8aec Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 10 Dec 2022 12:58:08 -0600 Subject: [PATCH 271/357] rework the getenv test again * use a virtual fat filesystem during the test * this makes the file I/O part more closely patch runtime which is nice * side-steps the need to add a special function for testing * but test still can't be run on a device, because the vfs calls are incompatible, and you intentionally can't remount "/" anyway * and side-steps problems with storing 'bad' toml files --- .pre-commit-config.yaml | 4 +- ports/unix/main.c | 8 --- ports/unix/modos.c | 5 ++ shared-module/os/getenv.c | 47 +++++--------- tests/circuitpython/bad1.toml | 1 - tests/circuitpython/bad2.toml | 1 - tests/circuitpython/bad3.toml | 1 - tests/circuitpython/bad4.toml | 1 - tests/circuitpython/getenv_test.py | 88 +++++++++++++++++++++----- tests/circuitpython/getenv_test.py.exp | 31 ++++----- tests/circuitpython/good.toml | 14 ---- 11 files changed, 109 insertions(+), 92 deletions(-) delete mode 100644 tests/circuitpython/bad1.toml delete mode 100644 tests/circuitpython/bad2.toml delete mode 100644 tests/circuitpython/bad3.toml delete mode 100644 tests/circuitpython/bad4.toml delete mode 100644 tests/circuitpython/good.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 05e193f0e9..1905b233cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,9 +8,9 @@ repos: hooks: - id: check-yaml - id: end-of-file-fixer - exclude: '^(tests/.*\.toml|tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)' + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)' - id: trailing-whitespace - exclude: '^(tests/.*\.toml|tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/.*)' + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/.*)' - repo: local hooks: - id: translations diff --git a/ports/unix/main.c b/ports/unix/main.c index e423634e58..5ebcf9193b 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -420,13 +420,6 @@ STATIC void set_sys_argv(char *argv[], int argc, int start_arg) { #define PATHLIST_SEP_CHAR ':' #endif -mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t default_); -STATIC mp_obj_t getenv_from_file(mp_obj_t path_in, mp_obj_t key_to_get_in) { - return common_hal_os_getenv_path(mp_obj_str_get_str(path_in), - mp_obj_str_get_str(key_to_get_in), mp_const_none); -} -MP_DEFINE_CONST_FUN_OBJ_2(getenv_from_file_obj, getenv_from_file); - MP_NOINLINE int main_(int argc, char **argv); int main(int argc, char **argv) { @@ -547,7 +540,6 @@ MP_NOINLINE int main_(int argc, char **argv) { MP_DECLARE_CONST_FUN_OBJ_0(extra_cpp_coverage_obj); mp_store_global(MP_QSTR_extra_coverage, MP_OBJ_FROM_PTR(&extra_coverage_obj)); mp_store_global(MP_QSTR_extra_cpp_coverage, MP_OBJ_FROM_PTR(&extra_cpp_coverage_obj)); - mp_store_global(MP_QSTR_getenv_from_file, MP_OBJ_FROM_PTR(&getenv_from_file_obj)); } #endif diff --git a/ports/unix/modos.c b/ports/unix/modos.c index 6241dfa6c3..deea3bfc91 100644 --- a/ports/unix/modos.c +++ b/ports/unix/modos.c @@ -193,7 +193,12 @@ STATIC mp_obj_t mod_os_system(mp_obj_t cmd_in) { } MP_DEFINE_CONST_FUN_OBJ_1(mod_os_system_obj, mod_os_system); +mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_); STATIC mp_obj_t mod_os_getenv(mp_obj_t var_in) { + mp_obj_t result = common_hal_os_getenv(mp_obj_str_get_str(var_in), mp_const_none); + if (result != mp_const_none) { + return result; + } const char *s = getenv(mp_obj_str_get_str(var_in)); if (s == NULL) { return mp_const_none; diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index 09dc19748d..0112a8a5cd 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -39,43 +39,29 @@ #include "supervisor/filesystem.h" #include "supervisor/memory.h" -#define GETENV_PATH "settings.toml" +#define GETENV_PATH "/settings.toml" -#if defined(UNIX) -typedef FILE *file_arg; -STATIC bool open_file(const char *name, file_arg *active_file) { - FILE *result = fopen(name, "r"); - if (result) { - *active_file = result; - } - return result != NULL; -} -STATIC void close_file(file_arg *active_file) { - fclose(*active_file); -} -STATIC bool is_eof(file_arg *active_file) { - return feof(*active_file); -} -STATIC uint8_t get_next_byte(file_arg *active_file) { - int value = fgetc(*active_file); - if (value == EOF) { - return 0; - } - return value; -} -__attribute__((unused)) -STATIC void seek_eof(file_arg *active_file) { - fseek(*active_file, 0, SEEK_END); - (void)fgetc(*active_file); -} -#else #include "extmod/vfs.h" #include "extmod/vfs_fat.h" typedef FIL file_arg; STATIC bool open_file(const char *name, file_arg *active_file) { + #if defined(UNIX) + nlr_buf_t nlr; + if (nlr_push(&nlr) == 0) { + mp_obj_t file_obj = mp_call_function_2(MP_OBJ_FROM_PTR(&mp_builtin_open_obj), mp_obj_new_str(name, strlen(name)), MP_ROM_QSTR(MP_QSTR_rb)); + mp_arg_validate_type(file_obj, &mp_type_vfs_fat_fileio, MP_QSTR_file); + pyb_file_obj_t *file = MP_OBJ_TO_PTR(file_obj); + *active_file = file->fp; + nlr_pop(); + return true; + } else { + return false; + } + #else FATFS *fs = filesystem_circuitpy(); FRESULT result = f_open(fs, active_file, name, FA_READ); return result == FR_OK; + #endif } STATIC void close_file(file_arg *active_file) { // nothing @@ -95,7 +81,6 @@ STATIC uint8_t get_next_byte(FIL *active_file) { STATIC void seek_eof(file_arg *active_file) { f_lseek(active_file, f_size(active_file)); } -#endif // For a fixed buffer, record the required size rather than throwing STATIC void vstr_add_byte_nonstd(vstr_t *vstr, byte b) { @@ -363,7 +348,7 @@ mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t d vstr_init(&buf, 64); os_getenv_err_t result = os_getenv_vstr(path, key, &buf, "ed); - if (result == GETENV_ERR_NOT_FOUND) { + if (result == GETENV_ERR_NOT_FOUND || result == GETENV_ERR_OPEN) { return default_; } throw_getenv_error(result); diff --git a/tests/circuitpython/bad1.toml b/tests/circuitpython/bad1.toml deleted file mode 100644 index fce8db1800..0000000000 --- a/tests/circuitpython/bad1.toml +++ /dev/null @@ -1 +0,0 @@ -string = " diff --git a/tests/circuitpython/bad2.toml b/tests/circuitpython/bad2.toml deleted file mode 100644 index 666c573716..0000000000 --- a/tests/circuitpython/bad2.toml +++ /dev/null @@ -1 +0,0 @@ -string = """ diff --git a/tests/circuitpython/bad3.toml b/tests/circuitpython/bad3.toml deleted file mode 100644 index 705443a1c6..0000000000 --- a/tests/circuitpython/bad3.toml +++ /dev/null @@ -1 +0,0 @@ -string = diff --git a/tests/circuitpython/bad4.toml b/tests/circuitpython/bad4.toml deleted file mode 100644 index befe224084..0000000000 --- a/tests/circuitpython/bad4.toml +++ /dev/null @@ -1 +0,0 @@ -string=" \ No newline at end of file diff --git a/tests/circuitpython/getenv_test.py b/tests/circuitpython/getenv_test.py index d3735cc260..2f80e465e3 100644 --- a/tests/circuitpython/getenv_test.py +++ b/tests/circuitpython/getenv_test.py @@ -1,20 +1,78 @@ -def run_test(f, k=None): +import uos + +uos.umount("/") + + +class RAMBlockDevice: + ERASE_BLOCK_SIZE = 512 + + def __init__(self, blocks): + self.data = bytearray(blocks * self.ERASE_BLOCK_SIZE) + + def readblocks(self, block, buf, off=0): + addr = block * self.ERASE_BLOCK_SIZE + off + for i in range(len(buf)): + buf[i] = self.data[addr + i] + + def writeblocks(self, block, buf, off=None): + if off is None: + # erase, then write + off = 0 + addr = block * self.ERASE_BLOCK_SIZE + off + for i in range(len(buf)): + self.data[addr + i] = buf[i] + + def ioctl(self, op, arg): + if op == 4: # block count + return len(self.data) // self.ERASE_BLOCK_SIZE + if op == 5: # block size + return self.ERASE_BLOCK_SIZE + if op == 6: # erase block + return 0 + + +bdev = RAMBlockDevice(64) +uos.VfsFat.mkfs(bdev) +uos.mount(uos.VfsFat(bdev), "/") + +content_good = """ +# comment +key0 = "hello world" +key1 = 7 + cstring = "hello comment" # comment + cnumber = 0x7f # comment +key2= "\n" +key3 ="\u00c1x" +key4 = "\U000000c1x" +key5 = "\f\"\\" +key6 = "\t\r\b" +key7 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +key8 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +[section] +subvalue = "hi" +""" + +content_bad = [ + 'key = "\n', + 'key = """\n', + "key =\n", + 'key="', +] + + +def run_test(key, content): + with open("/settings.toml", "w") as f: + f.write(content) + try: - v = getenv_from_file(f"{BASE}/{f}.toml", k or f) - print(f, k, repr(v)) + v = uos.getenv(key) + print(key, repr(v)) except Exception as e: - print(f, k, str(e)) + print(key, str(e)) -BASE = __file__.rpartition("/")[0] or "." +for i in range(9): + run_test(f"key{i}", content_good) -run_test("good", "notpresent") -run_test("good", "string") -run_test("good", "number") -run_test("good", "cstring") -run_test("good", "cnumber") -run_test("good", "subvalue") -for i in range(8): - run_test("good", f"string{i}") -for i in range(1, 5): - run_test(f"bad{i}", f"string") +for content in content_bad: + run_test("key", content) diff --git a/tests/circuitpython/getenv_test.py.exp b/tests/circuitpython/getenv_test.py.exp index e7c58666c2..b09c376d19 100644 --- a/tests/circuitpython/getenv_test.py.exp +++ b/tests/circuitpython/getenv_test.py.exp @@ -1,18 +1,13 @@ -good.toml notpresent None -good.toml string 'hello world' -good.toml number 7 -good.toml cstring 'hello comment' -good.toml cnumber 127 -good.toml subvalue None -good.toml string0 None -good.toml string1 '\n' -good.toml string2 'Áx' -good.toml string3 'Áx' -good.toml string4 '\x0c"\\' -good.toml string5 '\t\r\x08' -good.toml string6 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' -good.toml string7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' -bad1.toml.bin string Invalid byte '\n' -bad2.toml.bin string Invalid byte '"' -bad3.toml.bin string invalid syntax for integer with base 10: '' -bad4.toml.bin string Invalid byte 'EOF' +key0 'hello world' +key1 7 +key2 Invalid byte '\n' +key3 'Áx' +key4 'Áx' +key5 Invalid byte '\\' +key6 '\t\r\x08' +key7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +key8 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +key Invalid byte '\n' +key Invalid byte '"' +key invalid syntax for integer with base 10: '' +key Invalid byte 'EOF' diff --git a/tests/circuitpython/good.toml b/tests/circuitpython/good.toml deleted file mode 100644 index 17e5c054f4..0000000000 --- a/tests/circuitpython/good.toml +++ /dev/null @@ -1,14 +0,0 @@ -# comment -string = "hello world" -number = 7 - cstring = "hello comment" # comment - cnumber = 0x7f # comment -string1= "\n" -string2 ="\u00c1x" -string3 = "\U000000c1x" -string4 = "\f\"\\" -string5 = "\t\r\b" -string6 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -string7 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -[section] -subvalue = "hi" From 6412d971facb6c0c75aaced897f39dc0a7d17bb2 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 11 Dec 2022 02:44:35 +0100 Subject: [PATCH 272/357] displayio: Set in_group to false when removing a layer from a group Otherwise the removed layer cannot be re-added. --- shared-module/displayio/Group.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index ad45852379..7eec72404f 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -310,6 +310,7 @@ static void _remove_layer(displayio_group_t *self, size_t index) { self->members->items[index], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { displayio_tilegrid_t *tilegrid = layer; + tilegrid->in_group = false; rendered_last_frame = displayio_tilegrid_get_previous_area(tilegrid, &layer_area); displayio_tilegrid_update_transform(tilegrid, NULL); } @@ -317,6 +318,7 @@ static void _remove_layer(displayio_group_t *self, size_t index) { self->members->items[index], &displayio_group_type); if (layer != MP_OBJ_NULL) { displayio_group_t *group = layer; + group->in_group = false; rendered_last_frame = displayio_group_get_previous_area(group, &layer_area); displayio_group_update_transform(group, NULL); } From da413094f8fa3fcc1043fe85796973a364d73e15 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Sun, 11 Dec 2022 13:01:00 +0100 Subject: [PATCH 273/357] Added LDO control pin and initial setup --- ports/nrf/boards/challenger_840/board.c | 7 +++++++ ports/nrf/boards/challenger_840/pins.c | 1 + 2 files changed, 8 insertions(+) diff --git a/ports/nrf/boards/challenger_840/board.c b/ports/nrf/boards/challenger_840/board.c index fb1ce4fb83..677b6eac8b 100644 --- a/ports/nrf/boards/challenger_840/board.c +++ b/ports/nrf/boards/challenger_840/board.c @@ -25,5 +25,12 @@ */ #include "supervisor/board.h" +#include "nrf_gpio.h" + +#define PORTPIN(x, y) (x * 32 + y) // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. +void board_init(void) { + nrf_gpio_cfg_output(PORTPIN(1, 9)); + nrf_gpio_pin_write(PORTPIN(1, 9), 1); +} diff --git a/ports/nrf/boards/challenger_840/pins.c b/ports/nrf/boards/challenger_840/pins.c index 26d780fffe..e059c17a15 100644 --- a/ports/nrf/boards/challenger_840/pins.c +++ b/ports/nrf/boards/challenger_840/pins.c @@ -32,6 +32,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_LDO_CONTROL), MP_ROM_PTR(&pin_P1_09) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_12) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_11) }, From fa14307c7d7bc297d550191c199ac621cc7b08a7 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sun, 11 Dec 2022 20:19:43 +0530 Subject: [PATCH 274/357] update `tj-actions/changed-files` to `v34.5.3` --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c584f5f427..9bae2e9983 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,7 +138,7 @@ jobs: - name: Get changes id: get-changes if: github.event_name == 'pull_request' - uses: tj-actions/changed-files@v34 + uses: tj-actions/changed-files@v34.5.3 with: json: true sha: ${{ steps.get-last-commit-with-checks.outputs.commit && github.event.after }} From 628865b2357bd1c344757a55ffbed763dc506121 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sun, 11 Dec 2022 20:32:12 +0530 Subject: [PATCH 275/357] change fetch-depth setting in ci --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bae2e9983..856072b50a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: false - fetch-depth: 1 + fetch-depth: 0 - name: Set up Python 3 uses: actions/setup-python@v4 with: From f7e735b492c4bf270ba8312a4459ac2cea4b17a4 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Sun, 11 Dec 2022 17:11:24 +0100 Subject: [PATCH 276/357] Added LDO control pin, new flash variants and support functions for the LDO control pin. --- ports/nrf/boards/challenger_840/board.c | 11 ----------- ports/nrf/boards/challenger_840/challenger_840.py | 14 ++++++++++++++ ports/nrf/boards/challenger_840/mpconfigboard.mk | 6 +++++- 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 ports/nrf/boards/challenger_840/challenger_840.py diff --git a/ports/nrf/boards/challenger_840/board.c b/ports/nrf/boards/challenger_840/board.c index 677b6eac8b..14a52fc4de 100644 --- a/ports/nrf/boards/challenger_840/board.c +++ b/ports/nrf/boards/challenger_840/board.c @@ -23,14 +23,3 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#include "supervisor/board.h" -#include "nrf_gpio.h" - -#define PORTPIN(x, y) (x * 32 + y) - -// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. -void board_init(void) { - nrf_gpio_cfg_output(PORTPIN(1, 9)); - nrf_gpio_pin_write(PORTPIN(1, 9), 1); -} diff --git a/ports/nrf/boards/challenger_840/challenger_840.py b/ports/nrf/boards/challenger_840/challenger_840.py new file mode 100644 index 0000000000..b40ae22b41 --- /dev/null +++ b/ports/nrf/boards/challenger_840/challenger_840.py @@ -0,0 +1,14 @@ +import board +import digitalio + +_LDO_PIN = digitalio.DigitalInOut(board.LDO_CONTROL) +_LDO_PIN.direction = digitalio.Direction.OUTPUT +_LDO_PIN.value = True + +def ldo_on(): + global _LDO_PIN + _LDO_PIN.value = True + +def ldo_off(): + global _LDO_PIN + _LDO_PIN.value = False diff --git a/ports/nrf/boards/challenger_840/mpconfigboard.mk b/ports/nrf/boards/challenger_840/mpconfigboard.mk index ddb55ce705..03cbc20b21 100644 --- a/ports/nrf/boards/challenger_840/mpconfigboard.mk +++ b/ports/nrf/boards/challenger_840/mpconfigboard.mk @@ -6,4 +6,8 @@ USB_MANUFACTURER = "Invector Labs AB" MCU_CHIP = nrf52840 SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ,W25Q32FV,W25Q64FV" +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ,W25Q32FV,W25Q32JVxQ,W25Q64FV,W25Q64JVxQ" + +FROZEN_MPY_DIRS += $(TOP)/ports/nrf/boards/challenger_840 +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BLE +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel From 66eca9c35e9da27232c67b9504b0bec6b6828dd0 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Sun, 11 Dec 2022 17:25:26 +0100 Subject: [PATCH 277/357] Updated formatting. --- ports/nrf/boards/challenger_840/challenger_840.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/nrf/boards/challenger_840/challenger_840.py b/ports/nrf/boards/challenger_840/challenger_840.py index b40ae22b41..bf3ae77170 100644 --- a/ports/nrf/boards/challenger_840/challenger_840.py +++ b/ports/nrf/boards/challenger_840/challenger_840.py @@ -5,10 +5,12 @@ _LDO_PIN = digitalio.DigitalInOut(board.LDO_CONTROL) _LDO_PIN.direction = digitalio.Direction.OUTPUT _LDO_PIN.value = True + def ldo_on(): global _LDO_PIN _LDO_PIN.value = True + def ldo_off(): global _LDO_PIN _LDO_PIN.value = False From 6426ddb73bd6d3a4760a45b44f7eb9fa7a17badb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Dec 2022 08:22:54 -0600 Subject: [PATCH 278/357] Rename test and add some additional cases While working on adding 0o and 0b literals (which aren't added yet and may not be) I realized that my approach would likely cause a problem for the value "0" --- tests/circuitpython/{getenv_test.py => getenv.py} | 7 ++++--- tests/circuitpython/{getenv_test.py.exp => getenv.py.exp} | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) rename tests/circuitpython/{getenv_test.py => getenv.py} (97%) rename tests/circuitpython/{getenv_test.py.exp => getenv.py.exp} (97%) diff --git a/tests/circuitpython/getenv_test.py b/tests/circuitpython/getenv.py similarity index 97% rename from tests/circuitpython/getenv_test.py rename to tests/circuitpython/getenv.py index 2f80e465e3..ad8fdbfeeb 100644 --- a/tests/circuitpython/getenv_test.py +++ b/tests/circuitpython/getenv.py @@ -39,8 +39,6 @@ content_good = """ # comment key0 = "hello world" key1 = 7 - cstring = "hello comment" # comment - cnumber = 0x7f # comment key2= "\n" key3 ="\u00c1x" key4 = "\U000000c1x" @@ -48,6 +46,9 @@ key5 = "\f\"\\" key6 = "\t\r\b" key7 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" key8 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + key9 = "hello comment" # comment + key10 = 0x7f # comment +key11 = 0 [section] subvalue = "hi" """ @@ -71,7 +72,7 @@ def run_test(key, content): print(key, str(e)) -for i in range(9): +for i in range(13): run_test(f"key{i}", content_good) for content in content_bad: diff --git a/tests/circuitpython/getenv_test.py.exp b/tests/circuitpython/getenv.py.exp similarity index 97% rename from tests/circuitpython/getenv_test.py.exp rename to tests/circuitpython/getenv.py.exp index b09c376d19..f83143c80b 100644 --- a/tests/circuitpython/getenv_test.py.exp +++ b/tests/circuitpython/getenv.py.exp @@ -7,6 +7,10 @@ key5 Invalid byte '\\' key6 '\t\r\x08' key7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' key8 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +key9 'hello comment' +key10 127 +key11 0 +key12 None key Invalid byte '\n' key Invalid byte '"' key invalid syntax for integer with base 10: '' From 1b15985783708fed54f83a60a33b04ee8705ea45 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Dec 2022 09:15:35 -0600 Subject: [PATCH 279/357] Fix web workflow builds --- supervisor/shared/web_workflow/web_workflow.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 5bac8522dd..58a68f0ec9 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -256,8 +256,8 @@ void supervisor_start_web_workflow(void) { return; } - result = common_hal_os_environ_get_key_str("CIRCUITPY_WIFI_PASSWORD", password, sizeof(password)); - if (result != ENVIRON_OK) { + result = common_hal_os_getenv_str("CIRCUITPY_WIFI_PASSWORD", password, sizeof(password)); + if (result != GETENV_OK) { return; } @@ -283,7 +283,7 @@ void supervisor_start_web_workflow(void) { mp_int_t new_port = web_api_port; // (leaves new_port unchanged on any failure) - (void)common_hal_os_environ_get_key_int("CIRCUITPY_WEB_API_PORT", &new_port); + (void)common_hal_os_getenv_int("CIRCUITPY_WEB_API_PORT", &new_port); bool first_start = pool.base.type != &socketpool_socketpool_type; bool port_changed = new_port != web_api_port; @@ -320,8 +320,8 @@ void supervisor_start_web_workflow(void) { const size_t api_password_len = sizeof(_api_password) - 1; - result = common_hal_os_environ_get_key_str("CIRCUITPY_WEB_API_PASSWORD", _api_password + 1, api_password_len); - if (result == ENVIRON_OK) { + result = common_hal_os_getenv_str("CIRCUITPY_WEB_API_PASSWORD", _api_password + 1, api_password_len); + if (result == GETENV_OK) { _api_password[0] = ':'; _base64_in_place(_api_password, strlen(_api_password), sizeof(_api_password) - 1); } From 3620d14542ceafe293c449ca633865c2420260c4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Dec 2022 17:04:03 -0600 Subject: [PATCH 280/357] Pass string length when enabling radio --- supervisor/shared/web_workflow/web_workflow.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 58a68f0ec9..87da0bd2a6 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -248,8 +248,6 @@ void supervisor_start_web_workflow(void) { char ssid[33]; char password[64]; - size_t ssid_len = 0; - size_t password_len = 0; os_getenv_err_t result = common_hal_os_getenv_str("CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid)); if (result != GETENV_OK) { @@ -273,7 +271,7 @@ void supervisor_start_web_workflow(void) { // network. If we are connected to a different network, then it will disconnect before // attempting to connect to the given network. _wifi_status = common_hal_wifi_radio_connect( - &common_hal_wifi_radio_obj, (uint8_t *)ssid, ssid_len, (uint8_t *)password, password_len, + &common_hal_wifi_radio_obj, (uint8_t *)ssid, strlen(ssid), (uint8_t *)password, strlen(password), 0, 8, NULL, 0); if (_wifi_status != WIFI_RADIO_ERROR_NONE) { From 808161eaaba61860e959515dc55696a780fb329d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Dec 2022 19:09:57 -0600 Subject: [PATCH 281/357] fix missing sentinel in call --- supervisor/shared/web_workflow/web_workflow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 87da0bd2a6..35d5c46a94 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -351,7 +351,7 @@ static void _send_str(socketpool_socket_obj_t *socket, const char *str) { } // The last argument must be NULL! Otherwise, it won't stop. -static void _send_strs(socketpool_socket_obj_t *socket, ...) { +static __attribute__((sentinel)) void _send_strs(socketpool_socket_obj_t *socket, ...) { va_list ap; va_start(ap, socket); @@ -691,7 +691,7 @@ static void _reply_with_file(socketpool_socket_obj_t *socket, _request *request, } else if (_endswith(filename, ".json")) { _send_strs(socket, "Content-Type:", "application/json", ";charset=UTF-8\r\n", NULL); } else { - _send_strs(socket, "Content-Type:", "application/octet-stream\r\n"); + _send_strs(socket, "Content-Type:", "application/octet-stream\r\n", NULL); } _cors_header(socket, request); _send_str(socket, "\r\n"); From 90894014a2e146e07c2ea4f9f840242fc33bf6a0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Dec 2022 19:43:10 -0600 Subject: [PATCH 282/357] Use the HW LED as status indicator For me this made a rare startup failure stop, which is nonsense. --- ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h index e5d8660b2b..a31ee7327c 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h +++ b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h @@ -4,5 +4,7 @@ #define CIRCUITPY_DIGITALIO_HAVE_INVALID_PULL (1) #define CIRCUITPY_DIGITALIO_HAVE_INVALID_DRIVE_MODE (1) +#define MICROPY_HW_LED_STATUS (&pin_CYW0) + #define CIRCUITPY_BOARD_I2C (1) #define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}} From adff93c61a4ed49cd81893270f269232452b7516 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Dec 2022 20:14:08 -0600 Subject: [PATCH 283/357] Mark cyw43 pins "never reset" before reset_port reset_port calls reset_all_pins, which disables the built-in pull down. In theory, this could allow some CYW43 interfacing pin to float to an inappropriate value. There's no proof of this! but the move can't really hurt, either --- ports/raspberrypi/supervisor/port.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 05d53fcc8d..27012f2298 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -127,6 +127,13 @@ safe_mode_t port_init(void) { (&_ld_dtcm_bss_start)[i] = 0; } + #if CIRCUITPY_CYW43 + never_reset_pin_number(23); + never_reset_pin_number(24); + never_reset_pin_number(25); + never_reset_pin_number(29); + #endif + // Reset everything into a known state before board_init. reset_port(); @@ -140,10 +147,6 @@ safe_mode_t port_init(void) { // Check brownout. #if CIRCUITPY_CYW43 - never_reset_pin_number(23); - never_reset_pin_number(24); - never_reset_pin_number(25); - never_reset_pin_number(29); // A small number of samples of pico w need an additional delay before // initializing the cyw43 chip. Delays inside cyw43_arch_init_with_country // are intended to meet the power on timing requirements, but apparently From aa5b1e063fd3977b9c43e21b5ec4703e79940210 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Tue, 13 Dec 2022 13:34:28 +0100 Subject: [PATCH 284/357] Added new RP2040 board with integrated SD/Card reader and RTC --- .../boards/challenger_rp2040_sdrtc/board.c | 29 +++++++ .../challenger_rp2040_sdrtc/mpconfigboard.h | 10 +++ .../challenger_rp2040_sdrtc/mpconfigboard.mk | 13 ++++ .../pico-sdk-configboard.h | 1 + .../boards/challenger_rp2040_sdrtc/pins.c | 76 +++++++++++++++++++ 5 files changed, 129 insertions(+) create mode 100644 ports/raspberrypi/boards/challenger_rp2040_sdrtc/board.c create mode 100644 ports/raspberrypi/boards/challenger_rp2040_sdrtc/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/challenger_rp2040_sdrtc/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/challenger_rp2040_sdrtc/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/challenger_rp2040_sdrtc/pins.c diff --git a/ports/raspberrypi/boards/challenger_rp2040_sdrtc/board.c b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/board.c new file mode 100644 index 0000000000..b66ea0e27f --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Pontus Oldberg, Invector Labs + * + * 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/challenger_rp2040_sdrtc/mpconfigboard.h b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/mpconfigboard.h new file mode 100644 index 0000000000..b8f08b9956 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "Challenger RP2040 SD/RTC" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_UART_BUS_TX (&pin_GPIO16) +#define DEFAULT_UART_BUS_RX (&pin_GPIO17) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/challenger_rp2040_sdrtc/mpconfigboard.mk b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/mpconfigboard.mk new file mode 100644 index 0000000000..022dbd143c --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x2e8a +USB_PID = 0x102d +USB_PRODUCT = "Challenger RP2040 SD/RTC" +USB_MANUFACTURER = "Invector Labs" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" + +CIRCUITPY__EVE = 1 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD diff --git a/ports/raspberrypi/boards/challenger_rp2040_sdrtc/pico-sdk-configboard.h b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/challenger_rp2040_sdrtc/pins.c b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/pins.c new file mode 100644 index 0000000000..7f4f620b59 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_sdrtc/pins.c @@ -0,0 +1,76 @@ +#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_SDA), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + + // RFM95W connections + { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_SD_SDO), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_SD_SDI), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_SD_CARD_DETECT), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_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); From d49af4d7848b432998d1d7e28995c7224643390e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 13 Dec 2022 08:11:47 -0600 Subject: [PATCH 285/357] make wording a bit clearer --- ports/raspberrypi/bindings/rp2pio/StateMachine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index f45dc07357..041d02e5cd 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -422,7 +422,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine //| ) -> None: //| """Write data to the TX fifo in the background, with optional looping. //| -//| First, if any previous ``once`` or ``loop`` buffer has not been started, this function blocks until they have. +//| First, if any previous ``once`` or ``loop`` buffer has not been started, this function blocks until they have been started. //| This means that any ``once`` or ``loop`` buffer will be written at least once. //| Then the ``once`` and/or ``loop`` buffers are queued. and the function returns. //| The ``once`` buffer (if specified) will be written just once. From 56d4f8f55265a104ed22a9905e24b1ac8ecca94b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 13 Dec 2022 11:32:33 -0600 Subject: [PATCH 286/357] can't use object-based calls at this time --- ports/nrf/common-hal/_bleio/Adapter.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 8948be1a5d..2c0c343877 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -54,6 +54,7 @@ #if CIRCUITPY_OS_GETENV #include "shared-bindings/os/__init__.h" +#include "shared-module/os/__init__.h" #endif #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) @@ -343,19 +344,17 @@ STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { default_ble_name[len - 1] = nibble_to_hex_lower[addr.addr[0] & 0xf]; default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings - mp_int_t name_len = 0; - #if CIRCUITPY_OS_GETENV - mp_obj_t ble_name = common_hal_os_getenv("CIRCUITPY_BLE_NAME", mp_const_none); - if (ble_name != mp_const_none) { - common_hal_bleio_adapter_set_name(self, mp_obj_str_get_str(ble_name)); + char ble_name[32]; + + os_getenv_err_t result = common_hal_os_getenv_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name)); + if (result == GETENV_OK) { + common_hal_bleio_adapter_set_name(self, ble_name); return; } #endif - if (name_len <= 0) { - common_hal_bleio_adapter_set_name(self, (char *)default_ble_name); - } + common_hal_bleio_adapter_set_name(self, (char *)default_ble_name); } static void bluetooth_adapter_background(void *data) { From 35f2046ab2703b9d23eb230bc9cddbe5d40eeaad Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 13 Dec 2022 12:02:07 -0600 Subject: [PATCH 287/357] Fix returning GETENV_ERR_LENGTH for over-long strings --- shared-module/os/getenv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index 0112a8a5cd..47b479f17c 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -86,6 +86,8 @@ STATIC void seek_eof(file_arg *active_file) { STATIC void vstr_add_byte_nonstd(vstr_t *vstr, byte b) { if (!vstr->fixed_buf || vstr->alloc > vstr->len) { vstr_add_byte(vstr, b); + } else { + vstr->len++; } } @@ -97,6 +99,8 @@ STATIC void vstr_add_char_nonstd(vstr_t *vstr, unichar c) { (c < 0x10000) ? 3 : 4; if (!vstr->fixed_buf || vstr->alloc > vstr->len + ulen) { vstr_add_char(vstr, c); + } else { + vstr->len += ulen; } } @@ -297,7 +301,7 @@ STATIC os_getenv_err_t os_getenv_buf_terminated(const char *key, char *value, si if (result == GETENV_OK) { vstr_add_byte_nonstd(&buf, 0); memcpy(value, buf.buf, MIN(buf.len, value_len)); - if (buf.len > value_len) { + if (buf.len > value_len) { // this length includes trailing NUL result = GETENV_ERR_LENGTH; } } From 5ac622a30d22bac54e8c9652d34d1ef113eb9a4e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 13 Dec 2022 13:13:01 -0600 Subject: [PATCH 288/357] get rid of nearly-empty getenv.c file --- py/circuitpy_defns.mk | 2 +- shared-bindings/os/getenv.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 shared-bindings/os/getenv.c diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 2deefda030..22ea67d05e 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -614,7 +614,6 @@ SRC_SHARED_MODULE_ALL = \ onewireio/__init__.c \ onewireio/OneWire.c \ os/__init__.c \ - os/getenv.c \ paralleldisplay/ParallelBus.c \ qrio/__init__.c \ qrio/QRDecoder.c \ @@ -715,6 +714,7 @@ endif SRC_SHARED_MODULE_INTERNAL = \ $(filter $(SRC_PATTERNS), \ displayio/display_core.c \ + os/getenv.c \ usb/utf16le.c \ ) diff --git a/shared-bindings/os/getenv.c b/shared-bindings/os/getenv.c deleted file mode 100644 index fdb5f0bb50..0000000000 --- a/shared-bindings/os/getenv.c +++ /dev/null @@ -1 +0,0 @@ -// this file needs to exist but does not have any content From d40ba94449b461035d032a69e5578826e6a9f5a6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 13 Dec 2022 13:19:10 -0600 Subject: [PATCH 289/357] explain why this is its own file --- shared-module/os/getenv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index 47b479f17c..d96b1fb306 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -24,6 +24,9 @@ * THE SOFTWARE. */ +// These functions are separate from __init__.c so that os.getenv() can be +// tested in the unix "coverage" build, without bringing in "our" os module + #include #include From 41beca14af513ed073f204b5ca1306999bc3e583 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 13 Dec 2022 16:00:24 -0600 Subject: [PATCH 290/357] only import a module if we use something from it This prevents a bogus line such as `from types import ` from being generated. surprisingly this was not detected as a problem until a change in isort! Formerly it would remove the bad line, but now it (correctly!) errors --- tools/extract_pyi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 7b87404fbc..5f4f9c9561 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -228,7 +228,8 @@ def convert_folder(top_level, stub_directory): imports, type_imports = extract_imports(tree) import_lines = ["from __future__ import annotations"] for type_module, used_types in type_imports.items(): - import_lines.append(f"from {type_module} import {', '.join(sorted(used_types))}") + if used_types: + import_lines.append(f"from {type_module} import {', '.join(sorted(used_types))}") import_lines.extend(f"import {m}" for m in sorted(imports)) import_body = "\n".join(import_lines) m = re.match(r'(\s*""".*?""")', stub_contents, flags=re.DOTALL) From 369507e1da49ab82f07ebdcc089783481552c3b2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 13 Dec 2022 18:39:25 -0500 Subject: [PATCH 291/357] cxd56 was not using SRC_SHARED_MODULE_INTERNAL --- ports/cxd56/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 5d06143f73..f90b6dd460 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -134,7 +134,8 @@ SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix common-hal/, $(SRC_COMMON_HAL)) SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \ - $(addprefix shared-module/, $(SRC_SHARED_MODULE)) + $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) SRC_S = supervisor/cpu.s From fa4b8093377da3ccdbb4594180336252381836d6 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 14 Dec 2022 01:56:45 +0100 Subject: [PATCH 292/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 26 +++++++++++++++++++++++--- locale/cs.po | 26 +++++++++++++++++++++++--- locale/de_DE.po | 26 +++++++++++++++++++++++--- locale/el.po | 26 +++++++++++++++++++++++--- locale/en_GB.po | 26 +++++++++++++++++++++++--- locale/es.po | 26 +++++++++++++++++++++++--- locale/fil.po | 26 +++++++++++++++++++++++--- locale/fr.po | 26 +++++++++++++++++++++++--- locale/hi.po | 26 +++++++++++++++++++++++--- locale/it_IT.po | 26 +++++++++++++++++++++++--- locale/ja.po | 26 +++++++++++++++++++++++--- locale/ko.po | 26 +++++++++++++++++++++++--- locale/nl.po | 26 +++++++++++++++++++++++--- locale/pl.po | 26 +++++++++++++++++++++++--- locale/pt_BR.po | 26 +++++++++++++++++++++++--- locale/ru.po | 26 +++++++++++++++++++++++--- locale/sv.po | 26 +++++++++++++++++++++++--- locale/tr.po | 26 +++++++++++++++++++++++--- locale/zh_Latn_pinyin.po | 26 +++++++++++++++++++++++--- 19 files changed, 437 insertions(+), 57 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index eb8effacb8..6551a3253f 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1015,6 +1015,10 @@ msgstr "" msgid "File exists" msgstr "File sudah ada" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1071,6 +1075,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Grup sudah digunakan" @@ -1199,6 +1205,7 @@ msgid "Internal define error" msgstr "Kesalahan definisi internal" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1245,6 +1252,11 @@ msgstr "Argumen tidak valid" msgid "Invalid bits per value" msgstr "Bit per nilai tidak valid" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1275,10 +1287,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Panjang kunci harus 16, 24, atau 32 byte" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2291,7 +2311,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Jumlah item pada RHS tidak cocok (diharapkan %d, didapatkan %d)." @@ -3174,7 +3194,7 @@ msgstr "lapisan (padding) tidak benar" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3553,7 +3573,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 67307d5715..7e550d8140 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1013,6 +1013,10 @@ msgstr "Fatální chyba." msgid "File exists" msgstr "soubor existuje" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1071,6 +1075,8 @@ msgstr "Základní chyba" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Skupina již byla použita" @@ -1199,6 +1205,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "Interní chyba" @@ -1245,6 +1252,11 @@ msgstr "Neplatný argument" msgid "Invalid bits per value" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1275,10 +1287,18 @@ msgstr "Chybný soket pro TLS" msgid "Invalid state" msgstr "Chybný stav" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Klíč musí být dlouhý 16, 24 nebo 32 bajtů" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "Mapování LED musí korespondovat s velikostí displeje" @@ -2280,7 +2300,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3161,7 +3181,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3540,7 +3560,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index cc1c20f2c0..f587d384a1 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1022,6 +1022,10 @@ msgstr "Fataler Fehler." msgid "File exists" msgstr "Datei existiert" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1082,6 +1086,8 @@ msgstr "Generischer Fehler" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Gruppe schon benutzt" @@ -1214,6 +1220,7 @@ msgid "Internal define error" msgstr "Interner Definitionsfehler" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "Interner Fehler" @@ -1260,6 +1267,11 @@ msgstr "Ungültiges Argument" msgid "Invalid bits per value" msgstr "Ungültige Bits pro Wert" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1290,10 +1302,18 @@ msgstr "Ungültiges Socket für TLS" msgid "Invalid state" msgstr "Ungültiger Zustand" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Der Schlüssel muss 16, 24 oder 32 Byte lang sein" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "LED-Zuordnungen müssen der Display-Größe entsprechen" @@ -2319,7 +2339,7 @@ msgid "Unkown error code %d" msgstr "Unbekannter Fehlercode %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3232,7 +3252,7 @@ msgstr "padding ist inkorrekt" msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3617,7 +3637,7 @@ msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" msgid "negative shift count" msgstr "Negative shift Anzahl" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/el.po b/locale/el.po index b187a003c1..7b4e3f2001 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1027,6 +1027,10 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1083,6 +1087,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -1209,6 +1215,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1255,6 +1262,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1285,10 +1297,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2289,7 +2309,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3170,7 +3190,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3549,7 +3569,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 07c9e578c8..8c97dbb7e2 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -1016,6 +1016,10 @@ msgstr "Fatal error." msgid "File exists" msgstr "File exists" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1072,6 +1076,8 @@ msgstr "Generic Failure" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Group already used" @@ -1200,6 +1206,7 @@ msgid "Internal define error" msgstr "Internal define error" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1246,6 +1253,11 @@ msgstr "Invalid argument" msgid "Invalid bits per value" msgstr "Invalid bits per value" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1276,10 +1288,18 @@ msgstr "Invalid socket for TLS" msgid "Invalid state" msgstr "Invalid state" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Key must be 16, 24, or 32 bytes long" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2293,7 +2313,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Unmatched number of items on RHS (expected %d, got %d)." @@ -3180,7 +3200,7 @@ msgstr "incorrect padding" msgid "index is out of bounds" msgstr "index is out of bounds" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3559,7 +3579,7 @@ msgstr "negative power with no float support" msgid "negative shift count" msgstr "negative shift count" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/es.po b/locale/es.po index f160e99a86..01f73ffd86 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1026,6 +1026,10 @@ msgstr "Error grave." msgid "File exists" msgstr "El archivo ya existe" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1083,6 +1087,8 @@ msgstr "Fallo Genérico" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Grupo ya está siendo utilizado" @@ -1218,6 +1224,7 @@ msgid "Internal define error" msgstr "Error interno de definición" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1264,6 +1271,11 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Inválido bits por valor" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1294,10 +1306,18 @@ msgstr "socket invalido para TLS" msgid "Invalid state" msgstr "Estado invalido" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "La llave debe tener 16, 24 o 32 bytes de longitud" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2325,7 +2345,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Número incomparable de elementos en RHS (%d esperado,%d obtenido)." @@ -3220,7 +3240,7 @@ msgstr "relleno (padding) incorrecto" msgid "index is out of bounds" msgstr "el índice está fuera de límites" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3603,7 +3623,7 @@ msgstr "potencia negativa sin float support" msgid "negative shift count" msgstr "cuenta de corrimientos negativo" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 988c921bfb..a4255383bd 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1012,6 +1012,10 @@ msgstr "" msgid "File exists" msgstr "Mayroong file" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1068,6 +1072,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -1196,6 +1202,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1242,6 +1249,11 @@ msgstr "Maling argumento" msgid "Invalid bits per value" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1272,10 +1284,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2280,7 +2300,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3174,7 +3194,7 @@ msgstr "mali ang padding" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3557,7 +3577,7 @@ msgstr "negatibong power na walang float support" msgid "negative shift count" msgstr "negative shift count" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 605e4e8eaa..1b31a9dcce 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1037,6 +1037,10 @@ msgstr "Erreurre fatale." msgid "File exists" msgstr "Le fichier existe" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1099,6 +1103,8 @@ msgstr "Échec génerique" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Groupe déjà utilisé" @@ -1237,6 +1243,7 @@ msgid "Internal define error" msgstr "Erreur de définition interne" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "Erreur interne" @@ -1284,6 +1291,11 @@ msgstr "Paramètre invalide" msgid "Invalid bits per value" msgstr "Bits par valeur invalides" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1314,10 +1326,18 @@ msgstr "Socket non valide pour TLS" msgid "Invalid state" msgstr "État invalide" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "La clé doit comporter 16, 24 ou 32 octets" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "La disposition des LED doit correspondre à la taille de l'écran" @@ -2350,7 +2370,7 @@ msgid "Unkown error code %d" msgstr "Erreur inconnue %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3260,7 +3280,7 @@ msgstr "espacement incorrect" msgid "index is out of bounds" msgstr "l'index est hors limites" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3646,7 +3666,7 @@ msgstr "puissance négative sans support des nombres à virgule flottante" msgid "negative shift count" msgstr "compte de décalage négatif" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/hi.po b/locale/hi.po index bd4f497f7b..3b7e9f26d4 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1002,6 +1002,10 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1058,6 +1062,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -1184,6 +1190,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1230,6 +1237,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1260,10 +1272,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2262,7 +2282,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3143,7 +3163,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3522,7 +3542,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 8a0d5cc526..d21b120e58 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1017,6 +1017,10 @@ msgstr "" msgid "File exists" msgstr "File esistente" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1073,6 +1077,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -1201,6 +1207,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1247,6 +1254,11 @@ msgstr "Argomento non valido" msgid "Invalid bits per value" msgstr "bits per valore invalido" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1277,10 +1289,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2290,7 +2310,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3182,7 +3202,7 @@ msgstr "padding incorretto" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3566,7 +3586,7 @@ msgstr "potenza negativa senza supporto per float" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 56e1272396..124bb762af 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1011,6 +1011,10 @@ msgstr "" msgid "File exists" msgstr "ファイルが存在します" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1067,6 +1071,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "グループはすでに使われています" @@ -1195,6 +1201,7 @@ msgid "Internal define error" msgstr "内部定義エラー" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1241,6 +1248,11 @@ msgstr "不正な引数" msgid "Invalid bits per value" msgstr "不正なbits per value" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1271,10 +1283,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Keyの長さは、16, 24, 32バイトのいずれかでなければなりません" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2276,7 +2296,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "右辺の要素数が一致しません (expected %d, got %d)" @@ -3161,7 +3181,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3541,7 +3561,7 @@ msgstr "" msgid "negative shift count" msgstr "シフトカウントが負数" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 0e6aa1ed34..fda78fbd95 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1005,6 +1005,10 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1061,6 +1065,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -1187,6 +1193,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1233,6 +1240,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1263,10 +1275,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2266,7 +2286,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3147,7 +3167,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3526,7 +3546,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 4759dce824..2bdb6e8a4c 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1010,6 +1010,10 @@ msgstr "" msgid "File exists" msgstr "Bestand bestaat" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1067,6 +1071,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Groep al gebruikt" @@ -1195,6 +1201,7 @@ msgid "Internal define error" msgstr "Interne define fout" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1241,6 +1248,11 @@ msgstr "Ongeldig argument" msgid "Invalid bits per value" msgstr "Ongeldige bits per waarde" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1271,10 +1283,18 @@ msgstr "" msgid "Invalid state" msgstr "" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Sleutel moet 16, 24, of 32 bytes lang zijn" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2286,7 +2306,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Niet overeenkomend aantal RHS items (verwachtte %d, kreeg %d)." @@ -3177,7 +3197,7 @@ msgstr "vulling (padding) is onjuist" msgid "index is out of bounds" msgstr "index is buiten bereik" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3559,7 +3579,7 @@ msgstr "negatieve macht terwijl er geen ondersteuning is voor float" msgid "negative shift count" msgstr "negatieve verschuivingstelling (shift count)" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 27ab7e4062..b399da6db1 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1011,6 +1011,10 @@ msgstr "" msgid "File exists" msgstr "Plik istnieje" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1067,6 +1071,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Grupa już używana" @@ -1195,6 +1201,7 @@ msgid "Internal define error" msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "" @@ -1241,6 +1248,11 @@ msgstr "Zły argument" msgid "Invalid bits per value" msgstr "Zła liczba bitów wartości" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1271,10 +1283,18 @@ msgstr "" msgid "Invalid state" msgstr "Nieprawidłowy stan" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Klucz musi mieć długość 16, 24 lub 32 bajtów" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2273,7 +2293,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Zła liczba obiektów po prawej stronie (oczekiwano %d, jest %d)." @@ -3155,7 +3175,7 @@ msgstr "złe wypełnienie" msgid "index is out of bounds" msgstr "indeks jest poza zakresem" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3534,7 +3554,7 @@ msgstr "ujemna potęga, ale brak obsługi liczb zmiennoprzecinkowych" msgid "negative shift count" msgstr "ujemne przesunięcie" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 7ef7f2109f..02380d5e8e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1029,6 +1029,10 @@ msgstr "Erro fatal." msgid "File exists" msgstr "Arquivo já existe" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1089,6 +1093,8 @@ msgstr "Falha Genérica" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "O grupo já está em uso" @@ -1223,6 +1229,7 @@ msgid "Internal define error" msgstr "Erro interno de definição" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "Erro interno" @@ -1269,6 +1276,11 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Os valores por bits são inválidos" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1299,10 +1311,18 @@ msgstr "Soquete inválido para o TLS" msgid "Invalid state" msgstr "Estado inválido" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "A chave deve ter 16, 24 ou 32 bytes de comprimento" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "Os mapeamentos do led devem corresponder ao tamanho do display" @@ -2332,7 +2352,7 @@ msgid "Unkown error code %d" msgstr "Código de erro desconhecido %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Quantidade inigualável de itens no RHS (%d esperado, obteve %d)." @@ -3237,7 +3257,7 @@ msgstr "preenchimento incorreto" msgid "index is out of bounds" msgstr "o índice está fora dos limites" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "o índice deve ser tupla ou int" @@ -3622,7 +3642,7 @@ msgstr "potência negativa sem suporte de flutuação" msgid "negative shift count" msgstr "contagem de turnos negativos" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "o índice aninhado deve ser int" diff --git a/locale/ru.po b/locale/ru.po index 1845bcb929..014adb5f94 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -1034,6 +1034,10 @@ msgstr "Фатальная ошибка." msgid "File exists" msgstr "Файл существует" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1098,6 +1102,8 @@ msgstr "Общий сбой" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Группа уже используется" @@ -1231,6 +1237,7 @@ msgid "Internal define error" msgstr "Внутренняя ошибка определения" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "Внутренняя ошибка" @@ -1278,6 +1285,11 @@ msgstr "Недопустимый аргумент" msgid "Invalid bits per value" msgstr "Недопустимое бит-на-значение" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1308,10 +1320,18 @@ msgstr "Неверный сокет для TLS" msgid "Invalid state" msgstr "Неверное состояние" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Ключ должен быть длинной 16, 24 или 32 байта" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "" @@ -2330,7 +2350,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3211,7 +3231,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3590,7 +3610,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index df1ab4a177..4b64cdb372 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1019,6 +1019,10 @@ msgstr "Fatalt fel." msgid "File exists" msgstr "Filen finns redan" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1077,6 +1081,8 @@ msgstr "Allmänt fel" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Grupp används redan" @@ -1207,6 +1213,7 @@ msgid "Internal define error" msgstr "Internt define-fel" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "Internt fel" @@ -1253,6 +1260,11 @@ msgstr "Ogiltigt argument" msgid "Invalid bits per value" msgstr "Ogiltigt värde för bitar per värde" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1283,10 +1295,18 @@ msgstr "Ogiltig socket för TLS" msgid "Invalid state" msgstr "Ogiltigt tillstånd" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Nyckeln måste vara 16, 24 eller 32 byte lång" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "LED-mappning måste matcha displaystorlek" @@ -2308,7 +2328,7 @@ msgid "Unkown error code %d" msgstr "Okänd felkod %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Omatchat antal på RHS (förväntat %d, fick %d)." @@ -3206,7 +3226,7 @@ msgstr "felaktig utfyllnad" msgid "index is out of bounds" msgstr "index är utanför gränserna" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "index måste vara tuple eller int" @@ -3588,7 +3608,7 @@ msgstr "negativ exponent utan stöd för flyttal" msgid "negative shift count" msgstr "negativt skiftantal" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "nästlat index måste vara en int" diff --git a/locale/tr.po b/locale/tr.po index feb86500fe..b5685d0878 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -1018,6 +1018,10 @@ msgstr "" msgid "File exists" msgstr "Dosya var" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1078,6 +1082,8 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Grup zaten kullanılıyor" @@ -1206,6 +1212,7 @@ msgid "Internal define error" msgstr "Dahili tanımlama hatası" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "Dahili hata" @@ -1253,6 +1260,11 @@ msgstr "Geçersiz argüman" msgid "Invalid bits per value" msgstr "Geçersiz bit başına değer" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1283,10 +1295,18 @@ msgstr "TLS için geçersiz soket" msgid "Invalid state" msgstr "Geçersiz durum" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Anahtar 16, 24 veya 32 bayt uzunluğunda olmalıdır" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "LED eşlemeleri ekran boyutuyla eşleşmelidir" @@ -2288,7 +2308,7 @@ msgid "Unkown error code %d" msgstr "" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -3169,7 +3189,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3548,7 +3568,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index e641213935..89f1c00379 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1020,6 +1020,10 @@ msgstr "zhì mìng cuò wù." msgid "File exists" msgstr "Wénjiàn cúnzài" +#: shared-module/os/getenv.c +msgid "File not found" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1080,6 +1084,8 @@ msgstr "tōng yòng gù zhàng" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Jítuán yǐjīng shǐyòngguò" @@ -1213,6 +1219,7 @@ msgid "Internal define error" msgstr "Nèibù dìngyì cuòwù" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: shared-module/os/getenv.c msgid "Internal error" msgstr "nèi bù cuò wù" @@ -1259,6 +1266,11 @@ msgstr "Wúxiào de cānshù" msgid "Invalid bits per value" msgstr "Měi gè zhí de wèi wúxiào" +#: shared-module/os/getenv.c +#, c-format +msgid "Invalid byte %.*s" +msgstr "" + #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" @@ -1289,10 +1301,18 @@ msgstr "TLS de chā zuò wú xiào" msgid "Invalid state" msgstr "wú xiào zhuàng tài" +#: shared-module/os/getenv.c +msgid "Invalid unicode escape" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "mì yào bì xū wéi 16, 24 huò 32 zì jié cháng" +#: shared-module/os/getenv.c +msgid "Key not found" +msgstr "" + #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" msgstr "LED yìng shè bì xū yǔ xiǎn shì píng chǐ cùn pǐ pèi" @@ -2313,7 +2333,7 @@ msgid "Unkown error code %d" msgstr "wèi zhī cuò wù dài %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c -#: shared-module/adafruit_pixelbuf/PixelMap.c +#: shared-module/_pixelmap/PixelMap.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "RHS (yùqí %d, huòdé %d) shàng wèi pǐpèi de xiàngmù." @@ -3212,7 +3232,7 @@ msgstr "bù zhèngquè de tiánchōng" msgid "index is out of bounds" msgstr "suǒyǐn chāochū fànwéi" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" msgstr "" @@ -3592,7 +3612,7 @@ msgstr "méiyǒu fú diǎn zhīchí de xiāojí gōnglǜ" msgid "negative shift count" msgstr "fù zhuǎnyí jìshù" -#: shared-bindings/adafruit_pixelbuf/PixelMap.c +#: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" msgstr "" From 297657ea9aaf181980c8e6b05307e0ea26d05807 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 14 Dec 2022 14:45:32 -0600 Subject: [PATCH 293/357] Refactor so that all sites of name lookup failure result in gaierror --- .../espressif/common-hal/socketpool/Socket.c | 4 +-- .../common-hal/socketpool/Socket.c | 16 ++-------- .../common-hal/socketpool/SocketPool.c | 21 +++++++++---- .../common-hal/socketpool/SocketPool.h | 2 +- shared-bindings/socketpool/SocketPool.c | 30 ++++++++++++------- shared-bindings/socketpool/SocketPool.h | 9 ++++++ 6 files changed, 49 insertions(+), 33 deletions(-) diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index c65771fb0b..18237a4d4e 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -369,7 +369,7 @@ void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *self, struct addrinfo *result_i; int error = lwip_getaddrinfo(host, NULL, &hints, &result_i); if (error != 0 || result_i == NULL) { - mp_raise_OSError(EHOSTUNREACH); + common_hal_socketpool_socketpool_raise_gaierror(SOCKETPOOL_EAI_NONAME, MP_QSTR_Name_space_or_space_service_space_not_space_known); } // Set parameters @@ -550,7 +550,7 @@ mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t *self, struct addrinfo *result_i; int error = lwip_getaddrinfo(host, NULL, &hints, &result_i); if (error != 0 || result_i == NULL) { - mp_raise_OSError(EHOSTUNREACH); + common_hal_socketpool_socketpool_raise_gaierror(SOCKETPOOL_EAI_NONAME, MP_QSTR_Name_space_or_space_service_space_not_space_known); } // Set parameters diff --git a/ports/raspberrypi/common-hal/socketpool/Socket.c b/ports/raspberrypi/common-hal/socketpool/Socket.c index be3f2cd087..fe12f461fb 100644 --- a/ports/raspberrypi/common-hal/socketpool/Socket.c +++ b/ports/raspberrypi/common-hal/socketpool/Socket.c @@ -872,11 +872,7 @@ bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t *socket, ip_addr_t bind_addr; const ip_addr_t *bind_addr_ptr = &bind_addr; if (hostlen > 0) { - int error = socketpool_resolve_host(socket->pool, host, &bind_addr); - if (error != 0) { - mp_raise_OSError(EHOSTUNREACH); - } - + socketpool_resolve_host_raise(socket->pool, host, &bind_addr); } else { bind_addr_ptr = IP_ANY_TYPE; } @@ -965,10 +961,7 @@ void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *socket, // get address ip_addr_t dest; - int error = socketpool_resolve_host(socket->pool, host, &dest); - if (error != 0) { - mp_raise_OSError(EHOSTUNREACH); - } + socketpool_resolve_host_raise(socket->pool, host, &dest); err_t err = ERR_ARG; switch (socket->type) { @@ -1163,10 +1156,7 @@ mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t *socket, const char *host, size_t hostlen, uint32_t port, const uint8_t *buf, uint32_t len) { int _errno; ip_addr_t ip; - int error = socketpool_resolve_host(socket->pool, host, &ip); - if (error != 0) { - mp_raise_OSError(EHOSTUNREACH); - } + socketpool_resolve_host_raise(socket->pool, host, &ip); mp_uint_t ret = 0; switch (socket->type) { diff --git a/ports/raspberrypi/common-hal/socketpool/SocketPool.c b/ports/raspberrypi/common-hal/socketpool/SocketPool.c index d2f403c852..bdbc7f67c5 100644 --- a/ports/raspberrypi/common-hal/socketpool/SocketPool.c +++ b/ports/raspberrypi/common-hal/socketpool/SocketPool.c @@ -57,7 +57,7 @@ STATIC void lwip_getaddrinfo_cb(const char *name, const ip_addr_t *ipaddr, void } } -int socketpool_resolve_host(socketpool_socketpool_obj_t *self, const char *host, ip_addr_t *addr) { +STATIC int socketpool_resolve_host(socketpool_socketpool_obj_t *self, const char *host, ip_addr_t *addr) { getaddrinfo_state_t state; state.status = 0; @@ -94,17 +94,26 @@ int socketpool_resolve_host(socketpool_socketpool_obj_t *self, const char *host, return 0; } -mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t *self, - const char *host) { - - ip_addr_t addr; - int result = socketpool_resolve_host(self, host, &addr); +void socketpool_resolve_host_raise(socketpool_socketpool_obj_t *self, const char *host, ip_addr_t *addr) { + int result = socketpool_resolve_host(self, host, addr); if (result < 0) { + printf("socket_resolve_host() returned %d\n", result); + common_hal_socketpool_socketpool_raise_gaierror(SOCKETPOOL_EAI_NONAME, MP_QSTR_Name_space_or_space_service_space_not_space_known); mp_raise_OSError(-result); } +} + +mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t *self, const char *host) { + + ip_addr_t addr; + socketpool_resolve_host_raise(self, host, &addr); char ip_str[IP4ADDR_STRLEN_MAX]; inet_ntoa_r(addr, ip_str, IP4ADDR_STRLEN_MAX); mp_obj_t ip_obj = mp_obj_new_str(ip_str, strlen(ip_str)); return ip_obj; } + +mp_obj_t common_hal_socketpool_socketpool_gethostbyname_raise(socketpool_socketpool_obj_t *self, const char *host) { + return common_hal_socketpool_socketpool_gethostbyname(self, host); +} diff --git a/ports/raspberrypi/common-hal/socketpool/SocketPool.h b/ports/raspberrypi/common-hal/socketpool/SocketPool.h index 3d498d9a49..a7ad36b92f 100644 --- a/ports/raspberrypi/common-hal/socketpool/SocketPool.h +++ b/ports/raspberrypi/common-hal/socketpool/SocketPool.h @@ -32,4 +32,4 @@ typedef struct { mp_obj_base_t base; } socketpool_socketpool_obj_t; -int socketpool_resolve_host(socketpool_socketpool_obj_t *self, const char *host, ip_addr_t *addr); +void socketpool_resolve_host_raise(socketpool_socketpool_obj_t *self, const char *host, ip_addr_t *addr); diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 4881a0597b..660aba63ed 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -36,8 +36,6 @@ #include "shared-bindings/socketpool/Socket.h" #include "shared-bindings/socketpool/SocketPool.h" -#define SOCKETPOOL_EAI_NONAME (-2) - //| class SocketPool: //| """A pool of socket resources available for the given radio. Only one //| SocketPool can be created for each radio. @@ -151,15 +149,7 @@ STATIC mp_obj_t socketpool_socketpool_getaddrinfo(size_t n_args, const mp_obj_t } if (ip_str == mp_const_none) { - ip_str = common_hal_socketpool_socketpool_gethostbyname(self, host); - } - - if (ip_str == mp_const_none) { - mp_obj_t exc_args[2] = { - MP_OBJ_NEW_SMALL_INT(SOCKETPOOL_EAI_NONAME), - MP_OBJ_NEW_QSTR(MP_QSTR_Name_space_or_space_service_space_not_space_known), - }; - nlr_raise(mp_obj_new_exception_args(&mp_type_gaierror, 2, exc_args)); + ip_str = common_hal_socketpool_socketpool_gethostbyname_raise(self, host); } mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(5, NULL)); @@ -203,3 +193,21 @@ const mp_obj_type_t socketpool_socketpool_type = { .make_new = socketpool_socketpool_make_new, .locals_dict = (mp_obj_dict_t *)&socketpool_socketpool_locals_dict, }; + +MP_WEAK +mp_obj_t common_hal_socketpool_socketpool_gethostbyname_raise(socketpool_socketpool_obj_t *self, const char *host) { + mp_obj_t ip_str = common_hal_socketpool_socketpool_gethostbyname(self, host); + if (ip_str == mp_const_none) { + common_hal_socketpool_socketpool_raise_gaierror(SOCKETPOOL_EAI_NONAME, MP_QSTR_Name_space_or_space_service_space_not_space_known); + } + return ip_str; +} + +MP_WEAK NORETURN +void common_hal_socketpool_socketpool_raise_gaierror(int value, qstr name) { + mp_obj_t exc_args[2] = { + MP_OBJ_NEW_SMALL_INT(value), + MP_OBJ_NEW_QSTR(name), + }; + nlr_raise(mp_obj_new_exception_args(&mp_type_gaierror, 2, exc_args)); +} diff --git a/shared-bindings/socketpool/SocketPool.h b/shared-bindings/socketpool/SocketPool.h index 5a2d9f4337..cecbdd86f1 100644 --- a/shared-bindings/socketpool/SocketPool.h +++ b/shared-bindings/socketpool/SocketPool.h @@ -52,6 +52,10 @@ typedef enum { SOCKETPOOL_TCP_NODELAY = 1, } socketpool_socketpool_tcpopt_t; +typedef enum { + SOCKETPOOL_EAI_NONAME = -2, +} socketpool_eai_t; + void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t *self, mp_obj_t radio); socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_t *self, @@ -59,6 +63,9 @@ socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_ mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t *self, const char *host); +// raises an exception instead of returning mp_const_none in the case of error +mp_obj_t common_hal_socketpool_socketpool_gethostbyname_raise(socketpool_socketpool_obj_t *self, + const char *host); // Non-allocating version for internal use. These sockets are not registered and, therefore, not // closed automatically. @@ -66,4 +73,6 @@ bool socketpool_socket(socketpool_socketpool_obj_t *self, socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type, socketpool_socket_obj_t *sock); +NORETURN void common_hal_socketpool_socketpool_raise_gaierror(int value, qstr name); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKETPOOL_H From 5c569f03c2dffbe2e07cd646b22e7d62a7e8c79f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 14 Dec 2022 19:34:26 -0500 Subject: [PATCH 294/357] redo pin never resetting for mimxrt10xx --- .../mimxrt10xx/boards/feather_m7_1011/board.c | 45 ++++++++++---- .../boards/feather_mimxrt1011/board.c | 44 ++++++++++---- .../boards/feather_mimxrt1062/board.c | 40 +++++++++---- ports/mimxrt10xx/boards/imxrt1010_evk/board.c | 47 ++++++++++----- ports/mimxrt10xx/boards/imxrt1020_evk/board.c | 44 ++++++++++---- ports/mimxrt10xx/boards/imxrt1060_evk/board.c | 59 +++++++++++++------ ports/mimxrt10xx/boards/metro_m7_1011/board.c | 42 +++++++++---- .../boards/sparkfun_teensy_micromod/board.c | 57 +++++++++++------- ports/mimxrt10xx/boards/teensy40/board.c | 56 ++++++++++++------ ports/mimxrt10xx/boards/teensy41/board.c | 58 ++++++++++++------ .../common-hal/microcontroller/Pin.c | 13 +++- .../common-hal/microcontroller/Pin.h | 7 +++ 12 files changed, 356 insertions(+), 156 deletions(-) diff --git a/ports/mimxrt10xx/boards/feather_m7_1011/board.c b/ports/mimxrt10xx/boards/feather_m7_1011/board.c index fa37b8ebfd..3f7f3bd575 100644 --- a/ports/mimxrt10xx/boards/feather_m7_1011/board.c +++ b/ports/mimxrt10xx/boards/feather_m7_1011/board.c @@ -26,21 +26,40 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { - // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_13);// SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_12);// SWCLK +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { + &pin_GPIO_AD_13,// SWDIO + &pin_GPIO_AD_12,// SWCLK // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_12); - common_hal_never_reset_pin(&pin_GPIO_SD_11); - common_hal_never_reset_pin(&pin_GPIO_SD_10); - common_hal_never_reset_pin(&pin_GPIO_SD_09); - common_hal_never_reset_pin(&pin_GPIO_SD_08); - common_hal_never_reset_pin(&pin_GPIO_SD_07); - common_hal_never_reset_pin(&pin_GPIO_SD_06); + &pin_GPIO_SD_12, + &pin_GPIO_SD_11, + &pin_GPIO_SD_10, + &pin_GPIO_SD_09, + &pin_GPIO_SD_08, + &pin_GPIO_SD_07, + &pin_GPIO_SD_06, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; } + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c index 1514503834..cc93da4dd2 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c @@ -26,23 +26,41 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { - // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_13);// SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_12);// SWCLK +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { + &pin_GPIO_AD_13,// SWDIO + &pin_GPIO_AD_12,// SWCLK // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_12); - common_hal_never_reset_pin(&pin_GPIO_SD_11); - common_hal_never_reset_pin(&pin_GPIO_SD_10); - common_hal_never_reset_pin(&pin_GPIO_SD_09); - common_hal_never_reset_pin(&pin_GPIO_SD_08); - common_hal_never_reset_pin(&pin_GPIO_SD_07); - common_hal_never_reset_pin(&pin_GPIO_SD_06); + &pin_GPIO_SD_12, + &pin_GPIO_SD_11, + &pin_GPIO_SD_10, + &pin_GPIO_SD_09, + &pin_GPIO_SD_08, + &pin_GPIO_SD_07, + &pin_GPIO_SD_06, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; +} + + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; } // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c index df3d502d80..3a3b7f0efd 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c @@ -26,22 +26,40 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);// SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);// SWCLK + &pin_GPIO_AD_B0_06,// SWDIO + &pin_GPIO_AD_B0_07,// SWCLK // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + &pin_GPIO_SD_B1_06, + &pin_GPIO_SD_B1_07, + &pin_GPIO_SD_B1_08, + &pin_GPIO_SD_B1_09, + &pin_GPIO_SD_B1_10, + &pin_GPIO_SD_B1_11, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; +} + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; } // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c index 5a4cbcfc66..d4cd29b645 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c @@ -26,25 +26,42 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { - // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_13); // SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_12); // SWCLK +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { + &pin_GPIO_AD_13, // SWDIO + &pin_GPIO_AD_12, // SWCLK // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_12); - common_hal_never_reset_pin(&pin_GPIO_SD_11); - common_hal_never_reset_pin(&pin_GPIO_SD_10); - common_hal_never_reset_pin(&pin_GPIO_SD_09); - common_hal_never_reset_pin(&pin_GPIO_SD_08); - common_hal_never_reset_pin(&pin_GPIO_SD_07); - common_hal_never_reset_pin(&pin_GPIO_SD_06); + &pin_GPIO_SD_12, + &pin_GPIO_SD_11, + &pin_GPIO_SD_10, + &pin_GPIO_SD_09, + &pin_GPIO_SD_08, + &pin_GPIO_SD_07, + &pin_GPIO_SD_06, // USB Pins - common_hal_never_reset_pin(&pin_GPIO_12); - common_hal_never_reset_pin(&pin_GPIO_13); + &pin_GPIO_12, + &pin_GPIO_13, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; +} + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; } // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c index a9eea2d14e..64ca9c2b00 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c @@ -26,26 +26,44 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_00);// SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_B0_01);// SWCLK + &pin_GPIO_AD_B0_00,// SWDIO + &pin_GPIO_AD_B0_01,// SWCLK // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + &pin_GPIO_SD_B1_06, + &pin_GPIO_SD_B1_07, + &pin_GPIO_SD_B1_08, + &pin_GPIO_SD_B1_09, + &pin_GPIO_SD_B1_10, + &pin_GPIO_SD_B1_11, // USB Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B1_11); - common_hal_never_reset_pin(&pin_GPIO_AD_B1_12); + &pin_GPIO_AD_B1_11, + &pin_GPIO_AD_B1_12, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; +} + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; } // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c index 12e75738f8..7406108109 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c @@ -26,30 +26,51 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);// SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);// SWCLK + &pin_GPIO_AD_B0_06, // SWDIO + &pin_GPIO_AD_B0_07, // SWCLK // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_B1_00); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_01); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_02); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_03); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_04); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + &pin_GPIO_SD_B1_00, + &pin_GPIO_SD_B1_01, + &pin_GPIO_SD_B1_02, + &pin_GPIO_SD_B1_03, + &pin_GPIO_SD_B1_04, + &pin_GPIO_SD_B1_05, + &pin_GPIO_SD_B1_06, + &pin_GPIO_SD_B1_07, + &pin_GPIO_SD_B1_08, + &pin_GPIO_SD_B1_09, + &pin_GPIO_SD_B1_10, + &pin_GPIO_SD_B1_11, // USB Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_01); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_03); + &pin_GPIO_AD_B0_01, + &pin_GPIO_AD_B0_03, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; } + + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/board.c b/ports/mimxrt10xx/boards/metro_m7_1011/board.c index 1514503834..8420ad4884 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/board.c +++ b/ports/mimxrt10xx/boards/metro_m7_1011/board.c @@ -26,23 +26,41 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_13);// SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_12);// SWCLK + &pin_GPIO_AD_13,// SWDIO + &pin_GPIO_AD_12,// SWCLK // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_12); - common_hal_never_reset_pin(&pin_GPIO_SD_11); - common_hal_never_reset_pin(&pin_GPIO_SD_10); - common_hal_never_reset_pin(&pin_GPIO_SD_09); - common_hal_never_reset_pin(&pin_GPIO_SD_08); - common_hal_never_reset_pin(&pin_GPIO_SD_07); - common_hal_never_reset_pin(&pin_GPIO_SD_06); + &pin_GPIO_SD_12, + &pin_GPIO_SD_11, + &pin_GPIO_SD_10, + &pin_GPIO_SD_09, + &pin_GPIO_SD_08, + &pin_GPIO_SD_07, + &pin_GPIO_SD_06, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; +} + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; } // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c index 55cd826de2..c9042c1fe3 100644 --- a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c @@ -26,31 +26,48 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { - // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { + &pin_GPIO_SD_B1_06, + &pin_GPIO_SD_B1_07, + &pin_GPIO_SD_B1_08, + &pin_GPIO_SD_B1_09, + &pin_GPIO_SD_B1_10, + &pin_GPIO_SD_B1_11, // FLEX flash 2 - common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); - common_hal_never_reset_pin(&pin_GPIO_EMC_01); - common_hal_never_reset_pin(&pin_GPIO_B0_13); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + &pin_GPIO_AD_B0_04, + &pin_GPIO_AD_B0_06, + &pin_GPIO_AD_B0_07, + &pin_GPIO_AD_B0_08, + &pin_GPIO_AD_B0_09, + &pin_GPIO_AD_B0_10, + &pin_GPIO_EMC_01, + &pin_GPIO_B0_13, + &pin_GPIO_AD_B0_11, // Data strobe needs protection despite being grounded - common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); + &pin_GPIO_SD_B1_05, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; +} + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; } // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/teensy40/board.c b/ports/mimxrt10xx/boards/teensy40/board.c index 55cd826de2..8bb1680f00 100644 --- a/ports/mimxrt10xx/boards/teensy40/board.c +++ b/ports/mimxrt10xx/boards/teensy40/board.c @@ -26,31 +26,49 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + &pin_GPIO_SD_B1_06, + &pin_GPIO_SD_B1_07, + &pin_GPIO_SD_B1_08, + &pin_GPIO_SD_B1_09, + &pin_GPIO_SD_B1_10, + &pin_GPIO_SD_B1_11, // FLEX flash 2 - common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); - common_hal_never_reset_pin(&pin_GPIO_EMC_01); - common_hal_never_reset_pin(&pin_GPIO_B0_13); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + &pin_GPIO_AD_B0_04, + &pin_GPIO_AD_B0_06, + &pin_GPIO_AD_B0_07, + &pin_GPIO_AD_B0_08, + &pin_GPIO_AD_B0_09, + &pin_GPIO_AD_B0_10, + &pin_GPIO_EMC_01, + &pin_GPIO_B0_13, + &pin_GPIO_AD_B0_11, // Data strobe needs protection despite being grounded - common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); + &pin_GPIO_SD_B1_05, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; +} + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; } // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index 628befd02b..8bb1680f00 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -26,29 +26,49 @@ */ #include "supervisor/board.h" -#include "boards/flash_config.h" -#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { +// These pins should never ever be reset; doing so could interfere with basic operation. +STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + &pin_GPIO_SD_B1_06, + &pin_GPIO_SD_B1_07, + &pin_GPIO_SD_B1_08, + &pin_GPIO_SD_B1_09, + &pin_GPIO_SD_B1_10, + &pin_GPIO_SD_B1_11, // FLEX flash 2 - common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); - common_hal_never_reset_pin(&pin_GPIO_EMC_01); - common_hal_never_reset_pin(&pin_GPIO_B0_13); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + &pin_GPIO_AD_B0_04, + &pin_GPIO_AD_B0_06, + &pin_GPIO_AD_B0_07, + &pin_GPIO_AD_B0_08, + &pin_GPIO_AD_B0_09, + &pin_GPIO_AD_B0_10, + &pin_GPIO_EMC_01, + &pin_GPIO_B0_13, + &pin_GPIO_AD_B0_11, // Data strobe needs protection despite being grounded - common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); + &pin_GPIO_SD_B1_05, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { + if (pin == _reset_forbidden_pins[i]) { + return true; + } + } + return false; } + +bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + if (_reset_forbidden(pin)) { + return true; + } + + // Other reset variations would go here. + + return false; +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 06a2a34fe1..37a0c9c1a1 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -44,17 +44,26 @@ void reset_all_pins(void) { if (never_reset_pins[pin->mux_idx]) { continue; } - *(uint32_t *)pin->mux_reg = pin->mux_reset; - *(uint32_t *)pin->cfg_reg = pin->pad_reset; + common_hal_reset_pin(pin); } } +MP_WEAK bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { + return false; +} + // Since i.MX pins need extra register and reset information to reset properly, // resetting pins by number alone has been removed. void common_hal_reset_pin(const mcu_pin_obj_t *pin) { if (pin == NULL) { return; } + + // Give the board a chance to reset the pin in a particular way, or not reset it at all. + if (mimxrt10xx_board_reset_pin_number(pin)) { + return; + } + never_reset_pins[pin->mux_idx] = false; claimed_pins[pin->mux_idx] = false; *(uint32_t *)pin->mux_reg = pin->mux_reset; diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index 2638eb89b8..c519d468cb 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -35,4 +35,11 @@ void reset_all_pins(void); void claim_pin(const mcu_pin_obj_t *pin); +// Allow the board to reset a pin in a board-specific way. This can be used +// for LEDs or enable pins to put them in a state beside the default pull-up, +// or to simply not reset the pin at all. +// Return true to indicate that the pin was handled in a special way. Returning false will lead to +// the port-default reset behavior. +extern bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin); + #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H From dddc3e31bd6fb993ec62a94c130c505bc9f3f6c2 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 14 Dec 2022 12:23:32 +0000 Subject: [PATCH 295/357] Translated using Weblate (Swedish) Currently translated at 100.0% (991 of 991 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 4b64cdb372..85d9845b78 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-12-04 17:47+0000\n" +"PO-Revision-Date: 2022-12-15 12:49+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1021,7 +1021,7 @@ msgstr "Filen finns redan" #: shared-module/os/getenv.c msgid "File not found" -msgstr "" +msgstr "Filen hittades inte" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c @@ -1263,7 +1263,7 @@ msgstr "Ogiltigt värde för bitar per värde" #: shared-module/os/getenv.c #, c-format msgid "Invalid byte %.*s" -msgstr "" +msgstr "Ogiltig byte %.*s" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format @@ -1297,7 +1297,7 @@ msgstr "Ogiltigt tillstånd" #: shared-module/os/getenv.c msgid "Invalid unicode escape" -msgstr "" +msgstr "Ogiltig unicode escape" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1305,7 +1305,7 @@ msgstr "Nyckeln måste vara 16, 24 eller 32 byte lång" #: shared-module/os/getenv.c msgid "Key not found" -msgstr "" +msgstr "Nyckeln hittades inte" #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" From b90a6413c2640c8e3df2f39b9bdcfd48fdd21794 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 15 Dec 2022 13:17:28 -0500 Subject: [PATCH 296/357] refactor to reduce duplicate code --- .../mimxrt10xx/boards/feather_m7_1011/board.c | 23 +++--------------- .../boards/feather_mimxrt1011/board.c | 24 +++---------------- .../boards/feather_mimxrt1062/board.c | 23 +++--------------- ports/mimxrt10xx/boards/imxrt1010_evk/board.c | 23 +++--------------- ports/mimxrt10xx/boards/imxrt1020_evk/board.c | 23 +++--------------- ports/mimxrt10xx/boards/imxrt1060_evk/board.c | 24 +++---------------- ports/mimxrt10xx/boards/metro_m7_1011/board.c | 23 +++--------------- .../boards/sparkfun_teensy_micromod/board.c | 23 +++--------------- ports/mimxrt10xx/boards/teensy40/board.c | 23 +++--------------- ports/mimxrt10xx/boards/teensy41/board.c | 23 +++--------------- .../common-hal/microcontroller/Pin.c | 21 ++++++++++++++++ .../common-hal/microcontroller/Pin.h | 3 +++ 12 files changed, 54 insertions(+), 202 deletions(-) diff --git a/ports/mimxrt10xx/boards/feather_m7_1011/board.c b/ports/mimxrt10xx/boards/feather_m7_1011/board.c index 3f7f3bd575..9587ea71e8 100644 --- a/ports/mimxrt10xx/boards/feather_m7_1011/board.c +++ b/ports/mimxrt10xx/boards/feather_m7_1011/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { &pin_GPIO_AD_13,// SWDIO &pin_GPIO_AD_12,// SWCLK @@ -41,25 +42,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { &pin_GPIO_SD_08, &pin_GPIO_SD_07, &pin_GPIO_SD_06, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c index cc93da4dd2..9587ea71e8 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { &pin_GPIO_AD_13,// SWDIO &pin_GPIO_AD_12,// SWCLK @@ -41,26 +42,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { &pin_GPIO_SD_08, &pin_GPIO_SD_07, &pin_GPIO_SD_06, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c index 3a3b7f0efd..5a8de5a522 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { // SWD Pins &pin_GPIO_AD_B0_06,// SWDIO &pin_GPIO_AD_B0_07,// SWCLK @@ -41,25 +42,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { &pin_GPIO_SD_B1_09, &pin_GPIO_SD_B1_10, &pin_GPIO_SD_B1_11, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c index d4cd29b645..b839ffa666 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { &pin_GPIO_AD_13, // SWDIO &pin_GPIO_AD_12, // SWCLK // FLEX flash @@ -43,25 +44,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // USB Pins &pin_GPIO_12, &pin_GPIO_13, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c index 64ca9c2b00..afbc0c58b5 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { // SWD Pins &pin_GPIO_AD_B0_00,// SWDIO &pin_GPIO_AD_B0_01,// SWCLK @@ -45,25 +46,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // USB Pins &pin_GPIO_AD_B1_11, &pin_GPIO_AD_B1_12, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c index 7406108109..f27f549c64 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { // SWD Pins &pin_GPIO_AD_B0_06, // SWDIO &pin_GPIO_AD_B0_07, // SWCLK @@ -51,26 +52,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { // USB Pins &pin_GPIO_AD_B0_01, &pin_GPIO_AD_B0_03, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/board.c b/ports/mimxrt10xx/boards/metro_m7_1011/board.c index 8420ad4884..27cbd3eb96 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/board.c +++ b/ports/mimxrt10xx/boards/metro_m7_1011/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { // SWD Pins &pin_GPIO_AD_13,// SWDIO &pin_GPIO_AD_12,// SWCLK @@ -42,25 +43,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { &pin_GPIO_SD_08, &pin_GPIO_SD_07, &pin_GPIO_SD_06, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c index c9042c1fe3..fda0b1d202 100644 --- a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { &pin_GPIO_SD_B1_06, &pin_GPIO_SD_B1_07, &pin_GPIO_SD_B1_08, @@ -49,25 +50,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { &pin_GPIO_AD_B0_11, // Data strobe needs protection despite being grounded &pin_GPIO_SD_B1_05, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/teensy40/board.c b/ports/mimxrt10xx/boards/teensy40/board.c index 8bb1680f00..8ece1546d7 100644 --- a/ports/mimxrt10xx/boards/teensy40/board.c +++ b/ports/mimxrt10xx/boards/teensy40/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { // FLEX flash &pin_GPIO_SD_B1_06, &pin_GPIO_SD_B1_07, @@ -50,25 +51,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { &pin_GPIO_AD_B0_11, // Data strobe needs protection despite being grounded &pin_GPIO_SD_B1_05, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index 8bb1680f00..8ece1546d7 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -29,7 +29,8 @@ #include "shared-bindings/microcontroller/Pin.h" // These pins should never ever be reset; doing so could interfere with basic operation. -STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { +// Used in common-hal/microcontroller/Pin.c +const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { // FLEX flash &pin_GPIO_SD_B1_06, &pin_GPIO_SD_B1_07, @@ -50,25 +51,7 @@ STATIC const mcu_pin_obj_t *_reset_forbidden_pins[] = { &pin_GPIO_AD_B0_11, // Data strobe needs protection despite being grounded &pin_GPIO_SD_B1_05, + NULL, // Must end in NULL. }; -STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { - for (size_t i = 0; i < MP_ARRAY_SIZE(_reset_forbidden_pins); i++) { - if (pin == _reset_forbidden_pins[i]) { - return true; - } - } - return false; -} - -bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { - if (_reset_forbidden(pin)) { - return true; - } - - // Other reset variations would go here. - - return false; -} - // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 37a0c9c1a1..e891b56a24 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -31,6 +31,22 @@ STATIC bool claimed_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; STATIC bool never_reset_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; +// Default is that no pins are forbidden to reset. +MP_WEAK const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = { + NULL, +}; + +STATIC bool _reset_forbidden(const mcu_pin_obj_t *pin) { + const mcu_pin_obj_t **forbidden_pin = &mimxrt10xx_reset_forbidden_pins[0]; + while (*forbidden_pin) { + if (pin == *forbidden_pin) { + return true; + } + forbidden_pin++; + } + return false; +} + // There are two numbering systems used here: // IOMUXC index, used for iterating through pins and accessing reset information, // and GPIO port and number, used to store claimed and reset tagging. The two number @@ -55,10 +71,15 @@ MP_WEAK bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin) { // Since i.MX pins need extra register and reset information to reset properly, // resetting pins by number alone has been removed. void common_hal_reset_pin(const mcu_pin_obj_t *pin) { + return; if (pin == NULL) { return; } + if (_reset_forbidden(pin)) { + return; + } + // Give the board a chance to reset the pin in a particular way, or not reset it at all. if (mimxrt10xx_board_reset_pin_number(pin)) { return; diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index c519d468cb..1bfbe41a18 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -35,6 +35,9 @@ void reset_all_pins(void); void claim_pin(const mcu_pin_obj_t *pin); +// List of pins that should never be reset. +extern const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[]; + // Allow the board to reset a pin in a board-specific way. This can be used // for LEDs or enable pins to put them in a state beside the default pull-up, // or to simply not reset the pin at all. From 66efed5ba5ab7d9fdf94868d76300fbedde66de5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 15 Dec 2022 15:49:58 -0500 Subject: [PATCH 297/357] fix AuthMode printing regression --- ports/espressif/common-hal/wifi/Network.c | 4 ++-- ports/raspberrypi/common-hal/wifi/Network.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/espressif/common-hal/wifi/Network.c b/ports/espressif/common-hal/wifi/Network.c index 5c9852a1f7..9a20decd4a 100644 --- a/ports/espressif/common-hal/wifi/Network.c +++ b/ports/espressif/common-hal/wifi/Network.c @@ -86,9 +86,9 @@ mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { } mp_obj_t authmode_list = mp_obj_new_list(0, NULL); if (authmode_mask != 0) { - for (uint8_t i = 0; i < 8; i++) { + for (uint8_t i = 0; i < 32; i++) { if ((authmode_mask >> i) & 1) { - mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, i)); + mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, 1 << i)); } } } diff --git a/ports/raspberrypi/common-hal/wifi/Network.c b/ports/raspberrypi/common-hal/wifi/Network.c index e9b64ffd2c..ef81247712 100644 --- a/ports/raspberrypi/common-hal/wifi/Network.c +++ b/ports/raspberrypi/common-hal/wifi/Network.c @@ -53,7 +53,7 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) { } mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { - uint8_t authmode_mask = 0; + uint32_t authmode_mask = 0; if (self->record.auth_mode == 0) { authmode_mask = AUTHMODE_OPEN; } @@ -71,9 +71,9 @@ mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { ; mp_obj_t authmode_list = mp_obj_new_list(0, NULL); if (authmode_mask != 0) { - for (uint8_t i = 0; i < 8; i++) { + for (uint32_t i = 0; i < 32; i++) { if ((authmode_mask >> i) & 1) { - mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, i)); + mp_obj_list_append(authmode_list, cp_enum_find(&wifi_authmode_type, 1 << i)); } } } From 73084ac79fb1ec7f03bf0991a1ee409ff6c32fe1 Mon Sep 17 00:00:00 2001 From: Bernhard Bablok Date: Fri, 16 Dec 2022 09:13:34 +0100 Subject: [PATCH 298/357] fixed typo (path) in postCreateCommand --- .devcontainer/cortex-m/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/cortex-m/devcontainer.json b/.devcontainer/cortex-m/devcontainer.json index 796f83a4eb..ee8aeb1ea0 100644 --- a/.devcontainer/cortex-m/devcontainer.json +++ b/.devcontainer/cortex-m/devcontainer.json @@ -3,7 +3,7 @@ { "name": "CircuitPython Cortex-M Build-Environment (base: Default Linux Universal)", "image": "mcr.microsoft.com/devcontainers/universal:2-linux", - "postCreateCommand": ".devcontainer/cortex-mq/on-create.sh", + "postCreateCommand": ".devcontainer/cortex-m/on-create.sh", "remoteEnv": { "PATH": "/workspaces/gcc-arm-none-eabi/bin:${containerEnv:PATH}" } // Features to add to the dev container. More info: https://containers.dev/features. From 1139fc1be9c316185d097d58d601a035d7700c46 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 16 Dec 2022 11:52:48 -0600 Subject: [PATCH 299/357] Revert "update protomatter to latest commit" This reverts commit 5d974c35ee620e36efa2148a6f64e1e7df1b55f5. --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index cc93ff18c3..d0a07e14ad 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit cc93ff18c3a20b25396cb2babaee8ed33bb79528 +Subproject commit d0a07e14adcd71a7c22bcceb16c55aadb5e0d104 From 90c805d8584969679a6ca3cb9662e39b31937d86 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Fri, 16 Dec 2022 02:11:12 +0100 Subject: [PATCH 300/357] esp32-camera: make the master_clock_pin really optional The master_clock_pin was already optional, but not specifying it would result in a crash. This fixes it, so it really can be omitted, when the camera module has its own clock source built in. --- ports/espressif/bindings/esp32_camera/Camera.c | 10 +++++----- ports/espressif/common-hal/esp32_camera/Camera.c | 13 ++++++++----- ports/espressif/esp32-camera | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ports/espressif/bindings/esp32_camera/Camera.c b/ports/espressif/bindings/esp32_camera/Camera.c index 9bcd398612..687a389fc3 100644 --- a/ports/espressif/bindings/esp32_camera/Camera.c +++ b/ports/espressif/bindings/esp32_camera/Camera.c @@ -50,8 +50,8 @@ //| vsync_pin: microcontroller.Pin, //| href_pin: microcontroller.Pin, //| i2c: busio.I2C, -//| external_clock_pin: microcontroller.Pin, -//| external_clock_frequency: int, +//| external_clock_pin: Optional[microcontroller.Pin] = None, +//| external_clock_frequency: int = 20_000_000, //| powerdown_pin: Optional[microcontroller.Pin] = None, //| reset_pin: Optional[microcontroller.Pin] = None, //| pixel_format: PixelFormat = PixelFormat.RGB565, @@ -101,8 +101,8 @@ STATIC mp_obj_t esp32_camera_camera_make_new(const mp_obj_type_t *type, size_t n { MP_QSTR_vsync_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_href_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_i2c, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, - { MP_QSTR_external_clock_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY }, - { MP_QSTR_external_clock_frequency, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_external_clock_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_NONE } }, + { MP_QSTR_external_clock_frequency, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 20000000L } }, { MP_QSTR_powerdown_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_NONE } }, { MP_QSTR_reset_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_NONE } }, { MP_QSTR_pixel_format, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_PTR((void *)&pixel_format_RGB565_obj) } }, @@ -125,7 +125,7 @@ STATIC mp_obj_t esp32_camera_camera_make_new(const mp_obj_type_t *type, size_t n const mcu_pin_obj_t *vsync_pin = validate_obj_is_free_pin(args[ARG_vsync_pin].u_obj); const mcu_pin_obj_t *href_pin = validate_obj_is_free_pin(args[ARG_href_pin].u_obj); busio_i2c_obj_t *i2c = MP_OBJ_TO_PTR(mp_arg_validate_type(args[ARG_i2c].u_obj, &busio_i2c_type, MP_QSTR_i2c)); - const mcu_pin_obj_t *external_clock_pin = validate_obj_is_free_pin(args[ARG_external_clock_pin].u_obj); + const mcu_pin_obj_t *external_clock_pin = validate_obj_is_free_pin_or_none(args[ARG_external_clock_pin].u_obj); const mcu_pin_obj_t *powerdown_pin = validate_obj_is_free_pin_or_none(args[ARG_powerdown_pin].u_obj); const mcu_pin_obj_t *reset_pin = validate_obj_is_free_pin_or_none(args[ARG_reset_pin].u_obj); const mp_int_t external_clock_frequency = mp_arg_validate_int_range(args[ARG_external_clock_frequency].u_int, 0, 40000000, MP_QSTR_clock_frequency); diff --git a/ports/espressif/common-hal/esp32_camera/Camera.c b/ports/espressif/common-hal/esp32_camera/Camera.c index 65d2d0fbc6..34ad1fbbb9 100644 --- a/ports/espressif/common-hal/esp32_camera/Camera.c +++ b/ports/espressif/common-hal/esp32_camera/Camera.c @@ -85,14 +85,20 @@ void common_hal_esp32_camera_camera_construct( for (int i = 0; i < 8; i++) { claim_pin_number(data_pins[i]); } - claim_pin(external_clock_pin); + maybe_claim_pin(external_clock_pin); claim_pin(pixel_clock_pin); claim_pin(vsync_pin); claim_pin(href_pin); maybe_claim_pin(powerdown_pin); maybe_claim_pin(reset_pin); - common_hal_pwmio_pwmout_construct(&self->pwm, external_clock_pin, 1, external_clock_frequency, true); + if (external_clock_pin) { + common_hal_pwmio_pwmout_construct(&self->pwm, external_clock_pin, 1, external_clock_frequency, true); + self->camera_config.ledc_timer = self->pwm.tim_handle.timer_num; + self->camera_config.ledc_channel = self->pwm.chan_handle.channel; + } else { + self->camera_config.ledc_channel = 0xff; // NO_CAMERA_LEDC_CHANNEL + } self->i2c = i2c; @@ -119,9 +125,6 @@ void common_hal_esp32_camera_camera_construct( self->camera_config.xclk_freq_hz = external_clock_frequency; - self->camera_config.ledc_timer = self->pwm.tim_handle.timer_num; - self->camera_config.ledc_channel = self->pwm.chan_handle.channel; - self->camera_config.pixel_format = pixel_format; self->camera_config.frame_size = frame_size; self->camera_config.jpeg_quality = jpeg_quality; diff --git a/ports/espressif/esp32-camera b/ports/espressif/esp32-camera index 54c3f61c86..4ff7f348d0 160000 --- a/ports/espressif/esp32-camera +++ b/ports/espressif/esp32-camera @@ -1 +1 @@ -Subproject commit 54c3f61c864c3d3ffd779042454554045b9dd9d2 +Subproject commit 4ff7f348d0713ea8eca022f73a059b0fe0934531 From 49dba47f4e0fa359304f59af873debc919691711 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 15 Dec 2022 21:34:47 +0000 Subject: [PATCH 301/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (991 of 991 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 02380d5e8e..c0e64fd9dc 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-12-05 21:48+0000\n" +"PO-Revision-Date: 2022-12-16 21:50+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.15-dev\n" +"X-Generator: Weblate 4.15\n" #: main.c msgid "" @@ -1031,7 +1031,7 @@ msgstr "Arquivo já existe" #: shared-module/os/getenv.c msgid "File not found" -msgstr "" +msgstr "Arquivo não encontrado" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c @@ -1279,7 +1279,7 @@ msgstr "Os valores por bits são inválidos" #: shared-module/os/getenv.c #, c-format msgid "Invalid byte %.*s" -msgstr "" +msgstr "Byte %.*s inválido" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format @@ -1313,7 +1313,7 @@ msgstr "Estado inválido" #: shared-module/os/getenv.c msgid "Invalid unicode escape" -msgstr "" +msgstr "Escape unicode inválido" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1321,7 +1321,7 @@ msgstr "A chave deve ter 16, 24 ou 32 bytes de comprimento" #: shared-module/os/getenv.c msgid "Key not found" -msgstr "" +msgstr "Chave não encontrada" #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" From aac324c4d124c83118cbe398d82be83450483f58 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 18 Dec 2022 22:49:28 +0000 Subject: [PATCH 302/357] added frozen modules, changed to 8BM FLASH --- .../boards/crcibernetica-ideaboard/mpconfigboard.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.mk b/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.mk index cbc468b3ec..3921140b5c 100644 --- a/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.mk +++ b/ports/espressif/boards/crcibernetica-ideaboard/mpconfigboard.mk @@ -5,5 +5,11 @@ IDF_TARGET = esp32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m -CIRCUITPY_ESP_FLASH_SIZE = 16MB +CIRCUITPY_ESP_FLASH_SIZE = 8MB CIRCUITPY_ESP32_CAMERA = 0 + +# Include these Python libraries in firmware +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SimpleIO +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Motor From f8ac1d9261c087d1f65886036289c2121c32cc0f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 2 Dec 2022 14:54:42 -0800 Subject: [PATCH 303/357] Rework the coproc API It is now a generic `memorymap` API and an ESP specific `espulp` module. Fixes #7218. Fixes #3234. Fixes #7300. --- locale/circuitpython.pot | 42 +++-- ports/espressif/Makefile | 13 +- ports/espressif/bindings/espulp/ULP.c | 144 ++++++++++++++++++ .../espressif/bindings/espulp/ULP.h | 17 ++- .../espressif/bindings/espulp/ULPAlarm.c | 38 +++-- .../espressif/bindings/espulp/ULPAlarm.h | 9 +- ports/espressif/bindings/espulp/__init__.c | 91 +++++++++++ .../Coproc.h => bindings/espulp/__init__.h} | 15 +- ports/espressif/common-hal/alarm/__init__.c | 29 +++- ports/espressif/common-hal/alarm/__init__.h | 7 +- .../common-hal/alarm/coproc/CoprocAlarm.c | 132 ---------------- ports/espressif/common-hal/coproc/Coproc.c | 73 --------- .../{coproc/__init__.c => espulp/ULP.c} | 79 ++++++++-- .../{coproc/CoprocMemory.h => espulp/ULP.h} | 10 +- ports/espressif/common-hal/espulp/ULPAlarm.c | 110 +++++++++++++ .../CoprocAlarm.h => espulp/ULPAlarm.h} | 17 +-- ports/espressif/common-hal/espulp/__init__.c | 34 +++++ .../common-hal/memorymap/AddressRange.c | 107 +++++++++++++ .../common-hal/memorymap/AddressRange.h | 38 +++++ .../espressif/common-hal/memorymap/__init__.c | 1 + .../common-hal/microcontroller/Processor.c | 1 + ports/espressif/esp-idf | 2 +- ports/espressif/mpconfigport.mk | 7 +- ports/espressif/supervisor/port.c | 8 +- py/circuitpy_defns.mk | 14 +- py/circuitpy_mpconfig.mk | 8 +- shared-bindings/alarm/__init__.c | 24 +-- shared-bindings/alarm/coproc/CoprocAlarm.c | 87 ----------- shared-bindings/coproc/Coproc.c | 110 ------------- shared-bindings/coproc/CoprocMemory.h | 39 ----- shared-bindings/coproc/__init__.c | 115 -------------- .../AddressRange.c} | 115 ++++++++------ .../memorymap/AddressRange.h | 34 ++--- shared-bindings/memorymap/__init__.c | 52 +++++++ shared-bindings/memorymap/__init__.h | 30 ++++ supervisor/shared/reload.c | 2 + supervisor/shared/web_workflow/web_workflow.c | 9 ++ 37 files changed, 922 insertions(+), 741 deletions(-) create mode 100644 ports/espressif/bindings/espulp/ULP.c rename shared-bindings/coproc/__init__.h => ports/espressif/bindings/espulp/ULP.h (73%) rename shared-bindings/coproc/Coproc.h => ports/espressif/bindings/espulp/ULPAlarm.c (52%) rename shared-bindings/alarm/coproc/CoprocAlarm.h => ports/espressif/bindings/espulp/ULPAlarm.h (79%) create mode 100644 ports/espressif/bindings/espulp/__init__.c rename ports/espressif/{common-hal/coproc/Coproc.h => bindings/espulp/__init__.h} (75%) delete mode 100644 ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c delete mode 100644 ports/espressif/common-hal/coproc/Coproc.c rename ports/espressif/common-hal/{coproc/__init__.c => espulp/ULP.c} (50%) rename ports/espressif/common-hal/{coproc/CoprocMemory.h => espulp/ULP.h} (82%) create mode 100644 ports/espressif/common-hal/espulp/ULPAlarm.c rename ports/espressif/common-hal/{alarm/coproc/CoprocAlarm.h => espulp/ULPAlarm.h} (71%) create mode 100644 ports/espressif/common-hal/espulp/__init__.c create mode 100644 ports/espressif/common-hal/memorymap/AddressRange.c create mode 100644 ports/espressif/common-hal/memorymap/AddressRange.h create mode 100644 ports/espressif/common-hal/memorymap/__init__.c delete mode 100644 shared-bindings/alarm/coproc/CoprocAlarm.c delete mode 100644 shared-bindings/coproc/Coproc.c delete mode 100644 shared-bindings/coproc/CoprocMemory.h delete mode 100644 shared-bindings/coproc/__init__.c rename shared-bindings/{coproc/CoprocMemory.c => memorymap/AddressRange.c} (59%) rename ports/espressif/common-hal/coproc/CoprocMemory.c => shared-bindings/memorymap/AddressRange.h (53%) create mode 100644 shared-bindings/memorymap/__init__.c create mode 100644 shared-bindings/memorymap/__init__.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 56c2396d46..0cf1027239 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -100,6 +100,7 @@ msgstr "" msgid "%q failure: %d" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -180,7 +181,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -393,6 +393,10 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -473,7 +477,7 @@ msgstr "" msgid "Already have all-matches listener" msgstr "" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -497,7 +501,7 @@ msgstr "" msgid "Array must contain halfwords (type 'H')" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "" @@ -914,10 +918,10 @@ msgstr "" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "" @@ -1020,7 +1024,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1628,11 +1631,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1748,6 +1754,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1792,6 +1802,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1936,7 +1950,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -2210,8 +2224,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2467,7 +2481,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -3725,7 +3739,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 4e72e5c45a..ddfcaeeb6e 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -100,8 +100,6 @@ INC += \ -isystem esp-idf/components/soc/include \ -isystem esp-idf/components/soc/$(IDF_TARGET)/include \ -isystem esp-idf/components/spi_flash/include \ - -isystem esp-idf/components/ulp/include \ - -isystem esp-idf/components/ulp/ulp_riscv/include \ -isystem esp-idf/components/$(IDF_TARGET_ARCH)/include \ -isystem esp-idf/components/$(IDF_TARGET_ARCH)/$(IDF_TARGET)/include @@ -261,6 +259,15 @@ CFLAGS += -isystem esp32-camera/driver/include CFLAGS += -isystem esp32-camera/conversions/include endif +ifneq ($(CIRCUITPY_ESPULP),0) +SRC_ULP := \ + $(wildcard common-hal/espulp/*.c) \ + $(wildcard bindings/espulp/*.c) +SRC_C += $(SRC_ULP) +CFLAGS += -isystem esp-idf/components/ulp/include +CFLAGS += -isystem esp-idf/components/ulp/ulp_riscv/include +endif + SRC_COMMON_HAL_EXPANDED = \ $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ @@ -364,7 +371,7 @@ ifneq ($(CIRCUITPY_BLEIO),0) BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libbtbb.a \ esp-idf/components/bt/controller/lib_esp32c3_family/$(IDF_TARGET)/libbtdm_app.a endif -ifneq ($(CIRCUITPY_COPROC),0) +ifneq ($(CIRCUITPY_ESPULP),0) ESP_IDF_COMPONENTS_LINK += ulp endif diff --git a/ports/espressif/bindings/espulp/ULP.c b/ports/espressif/bindings/espulp/ULP.c new file mode 100644 index 0000000000..6cd719277b --- /dev/null +++ b/ports/espressif/bindings/espulp/ULP.c @@ -0,0 +1,144 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 microDev + * + * 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 "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/util.h" +#include "bindings/espulp/ULP.h" + +#include "py/runtime.h" + +//| class ULP: +//| def __init__(self): +//| """The ultra-low-power processor. +//| +//| Raises an exception if another ULP has been instantiated. This +//| ensures that is is only used by one piece of code at a time.""" +//| ... +STATIC mp_obj_t espulp_ulp_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { + espulp_ulp_obj_t *self = m_new_obj(espulp_ulp_obj_t); + self->base.type = &espulp_ulp_type; + common_hal_espulp_ulp_construct(self); + return MP_OBJ_FROM_PTR(self); +} + +STATIC espulp_ulp_obj_t *get_ulp_obj(mp_obj_t self_in) { + if (!mp_obj_is_type(self_in, &espulp_ulp_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), MP_QSTR_ULP); + } + espulp_ulp_obj_t *self = MP_OBJ_TO_PTR(self_in); + if (common_hal_espulp_ulp_deinited(self)) { + raise_deinited_error(); + } + return self; +} + +//| def deinit(self) -> None: +//| """Deinitialises the camera and releases all memory resources for reuse.""" +//| ... +STATIC mp_obj_t espulp_ulp_deinit(mp_obj_t self_in) { + espulp_ulp_obj_t *self = get_ulp_obj(self_in); + common_hal_espulp_ulp_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(espulp_ulp_deinit_obj, espulp_ulp_deinit); + +//| def __enter__(self) -> ULP: +//| """No-op used by Context Managers.""" +//| ... +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +STATIC mp_obj_t espulp_ulp_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + return espulp_ulp_deinit(args[0]); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(espulp_ulp___exit___obj, 4, 4, espulp_ulp_obj___exit__); + +//| def run( +//| self, program: ReadableBuffer, *, pins: Sequence[microcontroller.Pin] = () +//| ) -> None: +//| """Loads the program into ULP memory and then runs the program. The given pins are +//| claimed and not reset until `halt()` is called. +//| +//| The program will continue to run even when the running Python is halted.""" +//| ... +STATIC mp_obj_t espulp_ulp_run(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_program, ARG_pins }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_program, MP_ARG_REQUIRED | MP_ARG_OBJ}, + { MP_QSTR_pins, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_empty_tuple} }, + }; + + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + espulp_ulp_obj_t *self = get_ulp_obj(pos_args[0]); + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[ARG_program].u_obj, &bufinfo, MP_BUFFER_READ); + + mp_obj_t pins_in = args[ARG_pins].u_obj; + const size_t num_pins = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(pins_in)); + uint32_t pin_mask = 0; + + for (mp_uint_t i = 0; i < num_pins; i++) { + mp_obj_t pin_obj = mp_obj_subscr(pins_in, MP_OBJ_NEW_SMALL_INT(i), MP_OBJ_SENTINEL); + validate_obj_is_free_pin(pin_obj); + pin_mask |= 1 << ((const mcu_pin_obj_t *)pin_obj)->number; + } + + common_hal_espulp_ulp_run(self, bufinfo.buf, bufinfo.len, pin_mask); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(espulp_ulp_run_obj, 2, espulp_ulp_run); + +//| def halt(self) -> None: +//| """Halts the running program and releases the pins given in `run()`.""" +//| ... +//| +STATIC mp_obj_t espulp_ulp_halt(mp_obj_t self_in) { + common_hal_espulp_ulp_halt(get_ulp_obj(self_in)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(espulp_ulp_halt_obj, espulp_ulp_halt); + +STATIC const mp_rom_map_elem_t espulp_ulp_locals_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&espulp_ulp_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&mp_identity_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&espulp_ulp___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_run), MP_ROM_PTR(&espulp_ulp_run_obj) }, + { MP_ROM_QSTR(MP_QSTR_halt), MP_ROM_PTR(&espulp_ulp_halt_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(espulp_ulp_locals_dict, espulp_ulp_locals_table); + +const mp_obj_type_t espulp_ulp_type = { + { &mp_type_type }, + .name = MP_QSTR_ULP, + .make_new = espulp_ulp_make_new, + .locals_dict = (mp_obj_t)&espulp_ulp_locals_dict, +}; diff --git a/shared-bindings/coproc/__init__.h b/ports/espressif/bindings/espulp/ULP.h similarity index 73% rename from shared-bindings/coproc/__init__.h rename to ports/espressif/bindings/espulp/ULP.h index 6f2b2a56ae..9f9c3ecf7f 100644 --- a/shared-bindings/coproc/__init__.h +++ b/ports/espressif/bindings/espulp/ULP.h @@ -24,14 +24,17 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_COPROC___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_COPROC___INIT___H +#pragma once #include "py/obj.h" -#include "common-hal/coproc/Coproc.h" +#include "common-hal/espulp/ULP.h" -extern void common_hal_coproc_run(coproc_coproc_obj_t *self); -extern void common_hal_coproc_halt(coproc_coproc_obj_t *self); -extern mp_obj_t common_hal_coproc_memory(coproc_coproc_obj_t *self); -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_COPROC___INIT___H +extern const mp_obj_type_t espulp_ulp_type; + +void common_hal_espulp_ulp_construct(espulp_ulp_obj_t *self); +bool common_hal_espulp_ulp_deinited(espulp_ulp_obj_t *self); +void common_hal_espulp_ulp_deinit(espulp_ulp_obj_t *self); + +void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t length, uint32_t pin_mask); +void common_hal_espulp_ulp_halt(espulp_ulp_obj_t *self); diff --git a/shared-bindings/coproc/Coproc.h b/ports/espressif/bindings/espulp/ULPAlarm.c similarity index 52% rename from shared-bindings/coproc/Coproc.h rename to ports/espressif/bindings/espulp/ULPAlarm.c index fbf9bd9ae0..e77fe7f834 100644 --- a/shared-bindings/coproc/Coproc.h +++ b/ports/espressif/bindings/espulp/ULPAlarm.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,17 +24,33 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_COPROC_COPROC_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_COPROC_COPROC_H +#include "bindings/espulp/ULPAlarm.h" -#include "common-hal/coproc/Coproc.h" +#include "py/runtime.h" -extern const mp_obj_type_t coproc_coproc_type; +//| class ULPAlarm: +//| """Trigger an alarm when the ULP requests wake-up.""" +//| +//| def __init__(self) -> None: +//| """Create an alarm that will be triggered when the ULP requests wake-up. +//| +//| The alarm is not active until it is passed to an `alarm`-enabling function, such as +//| `alarm.light_sleep_until_alarms()` or `alarm.exit_and_deep_sleep_until_alarms()`. +//| +//| """ +//| ... +//| +STATIC mp_obj_t espulp_ulpalarm_make_new(const mp_obj_type_t *type, + size_t n_args, size_t n_kw, const mp_obj_t *all_args) { -extern void common_hal_coproc_coproc_construct(coproc_coproc_obj_t *self, - const uint8_t *buf, const size_t buf_len, coproc_memory_obj_t *coproc_memory); + espulp_ulpalarm_obj_t *self = m_new_obj(espulp_ulpalarm_obj_t); + self->base.type = &espulp_ulpalarm_type; + common_hal_espulp_ulpalarm_construct(self); + return MP_OBJ_FROM_PTR(self); +} -extern void common_hal_coproc_coproc_deinit(coproc_coproc_obj_t *self); -extern bool common_hal_coproc_coproc_deinited(coproc_coproc_obj_t *self); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_COPROC_COPROC_H +const mp_obj_type_t espulp_ulpalarm_type = { + { &mp_type_type }, + .name = MP_QSTR_ULPAlarm, + .make_new = espulp_ulpalarm_make_new, +}; diff --git a/shared-bindings/alarm/coproc/CoprocAlarm.h b/ports/espressif/bindings/espulp/ULPAlarm.h similarity index 79% rename from shared-bindings/alarm/coproc/CoprocAlarm.h rename to ports/espressif/bindings/espulp/ULPAlarm.h index 8f3a85de56..75e96c0a45 100644 --- a/shared-bindings/alarm/coproc/CoprocAlarm.h +++ b/ports/espressif/bindings/espulp/ULPAlarm.h @@ -24,11 +24,10 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ALARM_COPROC_COPROCALARM_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_ALARM_COPROC_COPROCALARM_H +#pragma once -#include "common-hal/alarm/coproc/CoprocAlarm.h" +#include "common-hal/espulp/ULPAlarm.h" -extern const mp_obj_type_t alarm_coproc_coprocalarm_type; +extern const mp_obj_type_t espulp_ulpalarm_type; -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_ALARM_COPROC_COPROCALARM_H +void common_hal_espulp_ulpalarm_construct(espulp_ulpalarm_obj_t *self); diff --git a/ports/espressif/bindings/espulp/__init__.c b/ports/espressif/bindings/espulp/__init__.c new file mode 100644 index 0000000000..06c62175fa --- /dev/null +++ b/ports/espressif/bindings/espulp/__init__.c @@ -0,0 +1,91 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 microDev + * + * 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 "shared-bindings/util.h" +#include "bindings/espulp/__init__.h" +#include "bindings/espulp/ULP.h" +#include "bindings/espulp/ULPAlarm.h" + +#include "py/runtime.h" + +//| """ESP Ultra Low Power Processor Module +//| +//| The `espulp` module adds ability to load and run +//| programs on the ESP32-Sx's ultra-low-power RISC-V processor. +//| +//| .. code-block:: python +//| +//| import espulp +//| import memorymap +//| +//| shared_mem = memorymap.AddressRange(start=0x50000000, length=1024) +//| ulp = espulp.ULP() +//| +//| with open("program.bin", "rb") as f: +//| program = f.read() +//| +//| ulp.run(program) +//| print(shared_mem[0]) +//| # ulp.halt() +//| """ +//| ... +//| + +//| def get_rtc_gpio_number(pin: microcontroller.Pin) -> Optional[int]: +//| """Return the RTC GPIO number of the given pin or None if not connected +//| to RTC GPIO.""" +//| ... +//| + +STATIC mp_obj_t espulp_get_rtc_gpio_number(mp_obj_t pin_obj) { + const mcu_pin_obj_t *pin = validate_obj_is_pin(pin_obj); + mp_int_t number = common_hal_espulp_get_rtc_gpio_number(pin); + if (number < 0) { + return mp_const_none; + } + return MP_OBJ_NEW_SMALL_INT(number); +} +MP_DEFINE_CONST_FUN_OBJ_1(espulp_get_rtc_gpio_number_obj, espulp_get_rtc_gpio_number); + +STATIC const mp_rom_map_elem_t espulp_module_globals_table[] = { + // module name + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_espulp) }, + + // module functions + { MP_ROM_QSTR(MP_QSTR_get_rtc_gpio_number), MP_OBJ_FROM_PTR(&espulp_get_rtc_gpio_number_obj) }, + + // module classes + { MP_ROM_QSTR(MP_QSTR_ULP), MP_OBJ_FROM_PTR(&espulp_ulp_type) }, + { MP_ROM_QSTR(MP_QSTR_ULPAlarm), MP_OBJ_FROM_PTR(&espulp_ulpalarm_type) }, +}; +STATIC MP_DEFINE_CONST_DICT(espulp_module_globals, espulp_module_globals_table); + +const mp_obj_module_t espulp_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&espulp_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_espulp, espulp_module, CIRCUITPY_ESPULP); diff --git a/ports/espressif/common-hal/coproc/Coproc.h b/ports/espressif/bindings/espulp/__init__.h similarity index 75% rename from ports/espressif/common-hal/coproc/Coproc.h rename to ports/espressif/bindings/espulp/__init__.h index 19082871cc..70daf53183 100644 --- a/ports/espressif/common-hal/coproc/Coproc.h +++ b/ports/espressif/bindings/espulp/__init__.h @@ -24,17 +24,10 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COPROC_COPROC_H -#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COPROC_COPROC_H +#pragma once -#include "py/obj.h" -#include "common-hal/coproc/CoprocMemory.h" +#include "shared-bindings/microcontroller/Pin.h" -typedef struct { - mp_obj_base_t base; - uint8_t *buf; - size_t buf_len; - coproc_memory_obj_t *coproc_memory; -} coproc_coproc_obj_t; +void espulp_reset(void); -#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COPROC_COPROC_H +mp_int_t common_hal_espulp_get_rtc_gpio_number(const mcu_pin_obj_t *pin); diff --git a/ports/espressif/common-hal/alarm/__init__.c b/ports/espressif/common-hal/alarm/__init__.c index 02ce3e1082..574fab0151 100644 --- a/ports/espressif/common-hal/alarm/__init__.c +++ b/ports/espressif/common-hal/alarm/__init__.c @@ -35,11 +35,14 @@ #include "shared-bindings/alarm/pin/PinAlarm.h" #include "shared-bindings/alarm/time/TimeAlarm.h" #include "shared-bindings/alarm/touch/TouchAlarm.h" -#include "shared-bindings/alarm/coproc/CoprocAlarm.h" #include "shared-bindings/wifi/__init__.h" #include "shared-bindings/microcontroller/__init__.h" +#if CIRCUITPY_ESPULP +#include "bindings/espulp/ULPAlarm.h" +#endif + #include "common-hal/digitalio/DigitalInOut.h" #include "supervisor/port.h" @@ -67,7 +70,9 @@ void alarm_reset(void) { alarm_pin_pinalarm_reset(); alarm_time_timealarm_reset(); alarm_touch_touchalarm_reset(); - alarm_coproc_coprocalarm_reset(); + #if CIRCUITPY_ESPULP + espulp_ulpalarm_reset(); + #endif esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL); } @@ -82,9 +87,11 @@ STATIC esp_sleep_wakeup_cause_t _get_wakeup_cause(void) { if (alarm_touch_touchalarm_woke_this_cycle()) { return ESP_SLEEP_WAKEUP_TOUCHPAD; } - if (alarm_coproc_coprocalarm_woke_this_cycle()) { + #if CIRCUITPY_ESPULP + if (espulp_ulpalarm_woke_this_cycle()) { return ESP_SLEEP_WAKEUP_ULP; } + #endif // If waking from true deep sleep, modules will have lost their state, // so check the deep wakeup cause manually return esp_sleep_get_wakeup_cause(); @@ -113,9 +120,11 @@ mp_obj_t common_hal_alarm_record_wake_alarm(void) { return alarm_touch_touchalarm_record_wake_alarm(); } + #if CIRCUITPY_ESPULP case ESP_SLEEP_WAKEUP_ULP: { - return alarm_coproc_coprocalarm_record_wake_alarm(); + return espulp_ulpalarm_record_wake_alarm(); } + #endif case ESP_SLEEP_WAKEUP_UNDEFINED: default: @@ -130,7 +139,9 @@ STATIC void _setup_sleep_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t alarm_pin_pinalarm_set_alarms(deep_sleep, n_alarms, alarms); alarm_time_timealarm_set_alarms(deep_sleep, n_alarms, alarms); alarm_touch_touchalarm_set_alarm(deep_sleep, n_alarms, alarms); - alarm_coproc_coprocalarm_set_alarm(deep_sleep, n_alarms, alarms); + #if CIRCUITPY_ESPULP + espulp_ulpalarm_set_alarm(deep_sleep, n_alarms, alarms); + #endif } mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj_t *alarms) { @@ -157,10 +168,12 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj wake_alarm = alarm_touch_touchalarm_find_triggered_alarm(n_alarms,alarms); break; } + #if CIRCUITPY_ESPULP case ESP_SLEEP_WAKEUP_ULP: { - wake_alarm = alarm_coproc_coprocalarm_find_triggered_alarm(n_alarms,alarms); + wake_alarm = espulp_ulpalarm_find_triggered_alarm(n_alarms,alarms); break; } + #endif default: // Should not reach this, if all light sleep types are covered correctly break; @@ -187,7 +200,9 @@ void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *ala void NORETURN common_hal_alarm_enter_deep_sleep(void) { alarm_pin_pinalarm_prepare_for_deep_sleep(); alarm_touch_touchalarm_prepare_for_deep_sleep(); - alarm_coproc_coprocalarm_prepare_for_deep_sleep(); + #if CIRCUITPY_ESPULP + espulp_ulpalarm_prepare_for_deep_sleep(); + #endif // We no longer need to remember the pin preservations, since any pin resets are all done. clear_pin_preservations(); diff --git a/ports/espressif/common-hal/alarm/__init__.h b/ports/espressif/common-hal/alarm/__init__.h index 9f762f9c00..e0086ee61a 100644 --- a/ports/espressif/common-hal/alarm/__init__.h +++ b/ports/espressif/common-hal/alarm/__init__.h @@ -27,13 +27,16 @@ #pragma once #include "common-hal/alarm/SleepMemory.h" -#include "common-hal/alarm/coproc/CoprocAlarm.h" #include "common-hal/alarm/pin/PinAlarm.h" #include "common-hal/alarm/time/TimeAlarm.h" #include "common-hal/alarm/touch/TouchAlarm.h" +#if CIRCUITPY_ESPULP +#include "common-hal/espulp/ULPAlarm.h" +#endif + typedef union { - alarm_coproc_coprocalarm_obj_t coproc_alarm; + espulp_ulpalarm_obj_t ulp_alarm; alarm_pin_pinalarm_obj_t pin_alarm; alarm_time_timealarm_obj_t time_alarm; alarm_touch_touchalarm_obj_t touch_alarm; diff --git a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c b/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c deleted file mode 100644 index 9ee187d27c..0000000000 --- a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 microDev - * - * 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 "shared-bindings/alarm/__init__.h" -#include "shared-bindings/alarm/coproc/CoprocAlarm.h" -#include "shared-bindings/coproc/__init__.h" - -#if CIRCUITPY_COPROC - -#include "supervisor/port.h" - -#include "driver/rtc_cntl.h" -#include "soc/rtc_cntl_reg.h" - -#include "esp_sleep.h" - -static volatile bool woke_up = false; - -mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms) { - for (size_t i = 0; i < n_alarms; i++) { - if (mp_obj_is_type(alarms[i], &alarm_coproc_coprocalarm_type)) { - return alarms[i]; - } - } - return mp_const_none; -} - -mp_obj_t alarm_coproc_coprocalarm_record_wake_alarm(void) { - alarm_coproc_coprocalarm_obj_t *const alarm = &alarm_wake_alarm.coproc_alarm; - - alarm->base.type = &alarm_coproc_coprocalarm_type; - return alarm; -} - -// This is used to wake the main CircuitPython task. -STATIC void coproc_interrupt(void *arg) { - (void)arg; - woke_up = true; - port_wake_main_task_from_isr(); -} - -void alarm_coproc_coprocalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms) { - bool coproc_alarm_set = false; - alarm_coproc_coprocalarm_obj_t *coproc_alarm = MP_OBJ_NULL; - - for (size_t i = 0; i < n_alarms; i++) { - if (mp_obj_is_type(alarms[i], &alarm_coproc_coprocalarm_type)) { - if (deep_sleep && coproc_alarm_set) { - mp_raise_ValueError_varg(translate("Only one %q can be set in deep sleep."), MP_QSTR_CoprocAlarm); - } - coproc_alarm = MP_OBJ_TO_PTR(alarms[i]); - coproc_alarm_set = true; - } - } - - if (!coproc_alarm_set) { - return; - } - - // enable coproc interrupt - rtc_isr_register(&coproc_interrupt, NULL, RTC_CNTL_COCPU_INT_ST); - REG_SET_BIT(RTC_CNTL_INT_ENA_REG, RTC_CNTL_COCPU_INT_ENA); - - // start coproc program - common_hal_coproc_run(coproc_alarm->coproc); -} - -void alarm_coproc_coprocalarm_prepare_for_deep_sleep(void) { - // disbale coproc interrupt - rtc_isr_deregister(&coproc_interrupt, NULL); - REG_CLR_BIT(RTC_CNTL_INT_ENA_REG, RTC_CNTL_COCPU_INT_ENA); - - // enable coproc wakeup - esp_sleep_enable_ulp_wakeup(); - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_ON); -} - -bool alarm_coproc_coprocalarm_woke_this_cycle(void) { - return woke_up; -} - -void alarm_coproc_coprocalarm_reset(void) { - woke_up = false; -} - -#else // CIRCUITPY_COPROC - -mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms) { - return mp_const_none; -} - -mp_obj_t alarm_coproc_coprocalarm_record_wake_alarm(void) { - return mp_const_none; -} - -void alarm_coproc_coprocalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms) { -} - -void alarm_coproc_coprocalarm_prepare_for_deep_sleep(void) { -} - -bool alarm_coproc_coprocalarm_woke_this_cycle(void) { - return false; -} - -void alarm_coproc_coprocalarm_reset(void) { -} - -#endif // CIRCUITPY_COPROC diff --git a/ports/espressif/common-hal/coproc/Coproc.c b/ports/espressif/common-hal/coproc/Coproc.c deleted file mode 100644 index c2115c1e94..0000000000 --- a/ports/espressif/common-hal/coproc/Coproc.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 microDev - * - * 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 "shared-bindings/coproc/Coproc.h" -#include "shared-bindings/coproc/CoprocMemory.h" - -#include "py/runtime.h" - -#if defined(CONFIG_IDF_TARGET_ESP32S2) -#include "esp32s2/ulp.h" -#define ULP_COPROC_RESERVE_MEM (CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM) -#elif defined(CONFIG_IDF_TARGET_ESP32S3) -#include "esp32s3/ulp.h" -#define ULP_COPROC_RESERVE_MEM (CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM) -#endif - -#define RTC_SLOW_MEM_END ((uint32_t)RTC_SLOW_MEM + ULP_COPROC_RESERVE_MEM) - -void common_hal_coproc_coproc_construct(coproc_coproc_obj_t *self, - const uint8_t *buf, const size_t buf_len, coproc_memory_obj_t *coproc_memory) { - // set CoprocMemory object - if (coproc_memory != NULL) { - if (coproc_memory->address < ((uint32_t)RTC_SLOW_MEM + buf_len) || - coproc_memory->address > (RTC_SLOW_MEM_END - coproc_memory->len)) { - mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_CoprocMemory); - } - } - self->coproc_memory = coproc_memory; - - // load buffer - if (buf_len > ULP_COPROC_RESERVE_MEM) { - mp_raise_RuntimeError(translate("Firmware is too big")); - } - self->buf_len = buf_len; - self->buf = (uint8_t *)m_malloc(self->buf_len, false); - memcpy(self->buf, buf, self->buf_len); -} - -bool common_hal_coproc_coproc_deinited(coproc_coproc_obj_t *self) { - return self->buf == NULL; -} - -void common_hal_coproc_coproc_deinit(coproc_coproc_obj_t *self) { - if (common_hal_coproc_coproc_deinited(self)) { - return; - } - m_free(self->buf); - self->buf = NULL; - self->coproc_memory = NULL; -} diff --git a/ports/espressif/common-hal/coproc/__init__.c b/ports/espressif/common-hal/espulp/ULP.c similarity index 50% rename from ports/espressif/common-hal/coproc/__init__.c rename to ports/espressif/common-hal/espulp/ULP.c index e372bfa235..8f80b5c9ec 100644 --- a/ports/espressif/common-hal/coproc/__init__.c +++ b/ports/espressif/common-hal/espulp/ULP.c @@ -24,49 +24,104 @@ * THE SOFTWARE. */ -#include "shared-bindings/coproc/__init__.h" +#include "bindings/espulp/__init__.h" +#include "bindings/espulp/ULP.h" #include "py/runtime.h" +#include "shared-bindings/microcontroller/Pin.h" + #if defined(CONFIG_IDF_TARGET_ESP32S2) #include "esp32s2/ulp.h" #include "esp32s2/ulp_riscv.h" +#define ULP_COPROC_RESERVE_MEM (CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM) #elif defined(CONFIG_IDF_TARGET_ESP32S3) #include "esp32s3/ulp.h" #include "esp32s3/ulp_riscv.h" +#define ULP_COPROC_RESERVE_MEM (CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM) #endif // To-do idf v5.0: remove following include #include "soc/rtc_cntl_reg.h" -void common_hal_coproc_run(coproc_coproc_obj_t *self) { +STATIC bool ulp_used = false; +STATIC uint32_t pins_used = 0; + +void espulp_reset(void) { + // NOTE: This *doesn't* disable the ULP. It'll keep running even when CircuitPython isn't. + ulp_used = false; +} + +void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t length, uint32_t pin_mask) { + if (length > ULP_COPROC_RESERVE_MEM) { + mp_raise_ValueError(translate("Program too long")); + } if (GET_PERI_REG_MASK(RTC_CNTL_ULP_CP_TIMER_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN)) { mp_raise_RuntimeError(translate("Already running")); } - ulp_riscv_load_binary(self->buf, self->buf_len); - m_free(self->buf); - self->buf = (uint8_t *)RTC_SLOW_MEM; + if (pin_mask >= (1 << 22)) { + mp_raise_ValueError(translate("Pins 21+ not supported from ULP")); + } + for (uint8_t i = 0; i < 32; i++) { + if ((pin_mask & (1 << i)) != 0 && !pin_number_is_free(i)) { + mp_raise_ValueError_varg(translate("%q in use"), MP_QSTR_Pin); + } + } + + for (uint8_t i = 0; i < 32; i++) { + if ((pin_mask & (1 << i)) != 0) { + claim_pin_number(i); + never_reset_pin_number(i); + } + } + pins_used = pin_mask; + + + ulp_riscv_load_binary((const uint8_t *)program, length); + ulp_set_wakeup_period(0, 20000); ulp_riscv_run(); } -void common_hal_coproc_halt(coproc_coproc_obj_t *self) { - self->buf = (uint8_t *)m_malloc(self->buf_len, false); - memcpy(self->buf, (uint8_t *)RTC_SLOW_MEM, self->buf_len); - +void common_hal_espulp_ulp_halt(espulp_ulp_obj_t *self) { // To-do idf v5.0: use following functions // ulp_riscv_timer_stop(); // ulp_riscv_halt(); - // stop the ulp timer + // stop the ulp timer so that is doesn't restart the cpu CLEAR_PERI_REG_MASK(RTC_CNTL_ULP_CP_TIMER_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN); + // suspends the ulp operation SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_DONE); + // resets the processor SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_RESET_EN); + + // Release pins we were using. + for (uint8_t i = 0; i < 32; i++) { + if ((pins_used & (1 << i)) != 0) { + reset_pin_number(i); + } + } } -mp_obj_t common_hal_coproc_memory(coproc_coproc_obj_t *self) { - return (self->coproc_memory) ? MP_OBJ_FROM_PTR(self->coproc_memory) : mp_const_none; +void common_hal_espulp_ulp_construct(espulp_ulp_obj_t *self) { + if (ulp_used) { + mp_raise_ValueError_varg(translate("%q in use"), MP_QSTR_ULP); + } + self->inited = true; +} + +bool common_hal_espulp_ulp_deinited(espulp_ulp_obj_t *self) { + return !self->inited; +} + +void common_hal_espulp_ulp_deinit(espulp_ulp_obj_t *self) { + if (common_hal_espulp_ulp_deinited(self)) { + return; + } + common_hal_espulp_ulp_halt(self); + self->inited = false; + ulp_used = false; } diff --git a/ports/espressif/common-hal/coproc/CoprocMemory.h b/ports/espressif/common-hal/espulp/ULP.h similarity index 82% rename from ports/espressif/common-hal/coproc/CoprocMemory.h rename to ports/espressif/common-hal/espulp/ULP.h index c4aa088394..f73b21d123 100644 --- a/ports/espressif/common-hal/coproc/CoprocMemory.h +++ b/ports/espressif/common-hal/espulp/ULP.h @@ -24,15 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COPROC_COPROCMEMORY_H -#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COPROC_COPROCMEMORY_H +#pragma once #include "py/obj.h" typedef struct { mp_obj_base_t base; - uint32_t address; - uint16_t len; -} coproc_memory_obj_t; - -#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_COPROC_COPROCMEMORY_H + bool inited; +} espulp_ulp_obj_t; diff --git a/ports/espressif/common-hal/espulp/ULPAlarm.c b/ports/espressif/common-hal/espulp/ULPAlarm.c new file mode 100644 index 0000000000..ec1fb8bc45 --- /dev/null +++ b/ports/espressif/common-hal/espulp/ULPAlarm.c @@ -0,0 +1,110 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 microDev + * + * 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 "bindings/espulp/ULPAlarm.h" + +#include "common-hal/alarm/__init__.h" +#include "supervisor/port.h" + +#include "driver/rtc_cntl.h" +#include "soc/rtc_cntl_reg.h" + +#include "esp_sleep.h" + +static volatile bool woke_up = false; +static bool alarm_set = false; + +void common_hal_espulp_ulpalarm_construct(espulp_ulpalarm_obj_t *self) { + +} + +mp_obj_t espulp_ulpalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms) { + for (size_t i = 0; i < n_alarms; i++) { + if (mp_obj_is_type(alarms[i], &espulp_ulpalarm_type)) { + return alarms[i]; + } + } + return mp_const_none; +} + +mp_obj_t espulp_ulpalarm_record_wake_alarm(void) { + espulp_ulpalarm_obj_t *const alarm = &alarm_wake_alarm.ulp_alarm; + + alarm->base.type = &espulp_ulpalarm_type; + return alarm; +} + +// This is used to wake the main CircuitPython task. +STATIC void ulp_interrupt(void *arg) { + (void)arg; + woke_up = true; + port_wake_main_task_from_isr(); +} + +void espulp_ulpalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms) { + espulp_ulpalarm_obj_t *alarm = MP_OBJ_NULL; + + for (size_t i = 0; i < n_alarms; i++) { + if (mp_obj_is_type(alarms[i], &espulp_ulpalarm_type)) { + if (alarm != MP_OBJ_NULL) { + mp_raise_ValueError_varg(translate("Only one %q can be set."), MP_QSTR_ULPAlarm); + } + alarm = MP_OBJ_TO_PTR(alarms[i]); + } + } + + if (alarm == MP_OBJ_NULL) { + return; + } + + // enable ulp interrupt + rtc_isr_register(&ulp_interrupt, NULL, RTC_CNTL_COCPU_INT_ST); + REG_SET_BIT(RTC_CNTL_INT_ENA_REG, RTC_CNTL_COCPU_INT_ENA); + + alarm_set = true; +} + +void espulp_ulpalarm_prepare_for_deep_sleep(void) { + if (!alarm_set) { + return; + } + // disable ulp interrupt + rtc_isr_deregister(&ulp_interrupt, NULL); + REG_CLR_BIT(RTC_CNTL_INT_ENA_REG, RTC_CNTL_COCPU_INT_ENA); + + // enable ulp wakeup + esp_sleep_enable_ulp_wakeup(); + esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_ON); +} + +bool espulp_ulpalarm_woke_this_cycle(void) { + return woke_up; +} + +void espulp_ulpalarm_reset(void) { + woke_up = false; + alarm_set = false; +} diff --git a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h b/ports/espressif/common-hal/espulp/ULPAlarm.h similarity index 71% rename from ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h rename to ports/espressif/common-hal/espulp/ULPAlarm.h index 57a9bcdbff..5d2610c6a3 100644 --- a/ports/espressif/common-hal/alarm/coproc/CoprocAlarm.h +++ b/ports/espressif/common-hal/espulp/ULPAlarm.h @@ -29,17 +29,14 @@ #include "py/obj.h" #include "py/runtime.h" -#include "common-hal/coproc/Coproc.h" - typedef struct { mp_obj_base_t base; - coproc_coproc_obj_t *coproc; -} alarm_coproc_coprocalarm_obj_t; +} espulp_ulpalarm_obj_t; -mp_obj_t alarm_coproc_coprocalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms); -mp_obj_t alarm_coproc_coprocalarm_record_wake_alarm(void); +mp_obj_t espulp_ulpalarm_find_triggered_alarm(const size_t n_alarms, const mp_obj_t *alarms); +mp_obj_t espulp_ulpalarm_record_wake_alarm(void); -void alarm_coproc_coprocalarm_prepare_for_deep_sleep(void); -void alarm_coproc_coprocalarm_reset(void); -void alarm_coproc_coprocalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms); -bool alarm_coproc_coprocalarm_woke_this_cycle(void); +void espulp_ulpalarm_prepare_for_deep_sleep(void); +void espulp_ulpalarm_reset(void); +void espulp_ulpalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms); +bool espulp_ulpalarm_woke_this_cycle(void); diff --git a/ports/espressif/common-hal/espulp/__init__.c b/ports/espressif/common-hal/espulp/__init__.c new file mode 100644 index 0000000000..5d403129a6 --- /dev/null +++ b/ports/espressif/common-hal/espulp/__init__.c @@ -0,0 +1,34 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Scott Shawcroft for Adafruit Industries LLC + * + * 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 "bindings/espulp/__init__.h" + +mp_int_t common_hal_espulp_get_rtc_gpio_number(const mcu_pin_obj_t *pin) { + if (pin->number <= 21) { + return pin->number; + } + return -1; +} diff --git a/ports/espressif/common-hal/memorymap/AddressRange.c b/ports/espressif/common-hal/memorymap/AddressRange.c new file mode 100644 index 0000000000..ed46c159bb --- /dev/null +++ b/ports/espressif/common-hal/memorymap/AddressRange.c @@ -0,0 +1,107 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * 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 + +#include "shared-bindings/memorymap/AddressRange.h" + +#include "py/runtime.h" + +#include "soc/soc.h" + +size_t allow_ranges[][2] = { + // ULP accessible RAM + {SOC_RTC_DATA_LOW, SOC_RTC_DATA_HIGH}, + // CPU accessible RAM that is preserved during sleep if the RTC power domain is left on. + {SOC_RTC_DRAM_LOW, SOC_RTC_DRAM_HIGH}, + // RTC peripheral registers + {0x60008000, 0x60009000} + +}; + +void common_hal_memorymap_addressrange_construct(memorymap_addressrange_obj_t *self, uint8_t *start_address, size_t length) { + bool allowed = false; + for (size_t i = 0; i < MP_ARRAY_SIZE(allow_ranges); i++) { + uint8_t *allowed_start = (uint8_t *)allow_ranges[i][0]; + uint8_t *allowed_end = (uint8_t *)allow_ranges[i][1]; + if (allowed_start <= start_address && + (start_address + length) <= allowed_end) { + allowed = true; + break; + } + } + + if (!allowed) { + mp_raise_ValueError(translate("Address range not allowed")); + } + + self->start_address = start_address; + self->len = length; +} + +size_t common_hal_memorymap_addressrange_get_length(const memorymap_addressrange_obj_t *self) { + return self->len; +} + +bool common_hal_memorymap_addressrange_set_bytes(const memorymap_addressrange_obj_t *self, + size_t start_index, uint8_t *values, size_t len) { + uint8_t *address = self->start_address + start_index; + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-align" + if (len == 1) { + *((uint8_t *)address) = values[0]; + } else if (len == sizeof(uint16_t) && (((size_t)address) % sizeof(uint16_t)) == 0) { + *((uint16_t *)address) = ((uint16_t *)values)[0]; + } else if (len == sizeof(uint32_t) && (((size_t)address) % sizeof(uint32_t)) == 0) { + *((uint32_t *)address) = ((uint32_t *)values)[0]; + } else if (len == sizeof(uint64_t) && (((size_t)address) % sizeof(uint64_t)) == 0) { + *((uint64_t *)address) = ((uint64_t *)values)[0]; + } else { + memcpy(address, values, len); + } + #pragma GCC diagnostic pop + + return true; +} + +void common_hal_memorymap_addressrange_get_bytes(const memorymap_addressrange_obj_t *self, + size_t start_index, size_t len, uint8_t *values) { + uint8_t *address = self->start_address + start_index; + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-align" + if (len == 1) { + values[0] = *((uint8_t *)address); + } else if (len == sizeof(uint16_t) && (((size_t)address) % sizeof(uint16_t)) == 0) { + ((uint16_t *)values)[0] = *((uint16_t *)address); + } else if (len == sizeof(uint32_t) && (((size_t)address) % sizeof(uint32_t)) == 0) { + ((uint32_t *)values)[0] = *((uint32_t *)address); + } else if (len == sizeof(uint64_t) && (((size_t)address) % sizeof(uint64_t)) == 0) { + ((uint64_t *)values)[0] = *((uint64_t *)address); + } else { + memcpy(values, address, len); + } + #pragma GCC diagnostic pop +} diff --git a/ports/espressif/common-hal/memorymap/AddressRange.h b/ports/espressif/common-hal/memorymap/AddressRange.h new file mode 100644 index 0000000000..e67cf32f5f --- /dev/null +++ b/ports/espressif/common-hal/memorymap/AddressRange.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 microDev + * + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MEMORYMAP_ADDRESSRANGE_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MEMORYMAP_ADDRESSRANGE_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint8_t *start_address; + size_t len; +} memorymap_addressrange_obj_t; + +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MEMORYMAP_ADDRESSRANGE_H diff --git a/ports/espressif/common-hal/memorymap/__init__.c b/ports/espressif/common-hal/memorymap/__init__.c new file mode 100644 index 0000000000..c15b17f451 --- /dev/null +++ b/ports/espressif/common-hal/memorymap/__init__.c @@ -0,0 +1 @@ +// No memorymap module functions. diff --git a/ports/espressif/common-hal/microcontroller/Processor.c b/ports/espressif/common-hal/microcontroller/Processor.c index bacc48c07b..1f09742955 100644 --- a/ports/espressif/common-hal/microcontroller/Processor.c +++ b/ports/espressif/common-hal/microcontroller/Processor.c @@ -139,6 +139,7 @@ mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) { case ESP_SLEEP_WAKEUP_EXT0: case ESP_SLEEP_WAKEUP_EXT1: case ESP_SLEEP_WAKEUP_TOUCHPAD: + case ESP_SLEEP_WAKEUP_ULP: return RESET_REASON_DEEP_SLEEP_ALARM; case ESP_SLEEP_WAKEUP_UNDEFINED: diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index 20c6d4a623..8d0f1abce7 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit 20c6d4a623a9391afd0e803b2bbebe020ed15ec8 +Subproject commit 8d0f1abce769ad4a212c1bb0337999cacd7ee83d diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index f1fa24a59b..c5c73c77bd 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -22,7 +22,6 @@ CIRCUITPY_AUDIOMP3 ?= 0 CIRCUITPY_BLEIO ?= 1 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_CANIO ?= 1 -CIRCUITPY_COPROC ?= 1 CIRCUITPY_COUNTIO ?= 1 CIRCUITPY_DUALBANK ?= 1 CIRCUITPY_ESP32_CAMERA ?= 1 @@ -44,7 +43,6 @@ CIRCUITPY_WIFI ?= 1 ifeq ($(IDF_TARGET),esp32) # Modules CIRCUITPY_BLEIO = 0 -CIRCUITPY_COPROC = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_RGBMATRIX = 0 # Features @@ -54,7 +52,6 @@ else ifeq ($(IDF_TARGET),esp32c3) # Modules CIRCUITPY_ALARM = 0 CIRCUITPY_AUDIOBUSIO = 0 -CIRCUITPY_COPROC = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_ESP32_CAMERA = 0 CIRCUITPY_FREQUENCYIO = 0 @@ -68,10 +65,14 @@ CIRCUITPY_USB = 0 else ifeq ($(IDF_TARGET),esp32s2) # Modules CIRCUITPY_BLEIO = 0 +CIRCUITPY_ESPULP = 1 +CIRCUITPY_MEMORYMAP = 1 else ifeq ($(IDF_TARGET),esp32s3) # Modules CIRCUITPY_PARALLELDISPLAY = 0 +CIRCUITPY_ESPULP = 1 +CIRCUITPY_MEMORYMAP = 1 endif # No room for dualbank on boards with 2MB flash diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index baeba5ce90..6dd09ed238 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -30,12 +30,14 @@ #include "supervisor/board.h" #include "supervisor/port.h" #include "supervisor/filesystem.h" +#include "supervisor/shared/reload.h" #include "py/runtime.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "bindings/espidf/__init__.h" +#include "bindings/espulp/__init__.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/analogio/AnalogOut.h" #include "common-hal/busio/I2C.h" @@ -367,6 +369,10 @@ void reset_port(void) { dualbank_reset(); #endif + #if CIRCUITPY_ESPULP + espulp_reset(); + #endif + #if CIRCUITPY_FREQUENCYIO peripherals_timer_reset(); #endif @@ -511,7 +517,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { // On the ESP we use FreeRTOS notifications instead of interrupts so this is a // bit of a misnomer. void port_idle_until_interrupt(void) { - if (!background_callback_pending()) { + if (!background_callback_pending() && !autoreload_pending()) { xTaskNotifyWait(0x01, 0x01, NULL, portMAX_DELAY); } } diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 22ea67d05e..be33d80a99 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -167,9 +167,6 @@ endif ifeq ($(CIRCUITPY_CANIO),1) SRC_PATTERNS += canio/% endif -ifeq ($(CIRCUITPY_COPROC),1) -SRC_PATTERNS += coproc/% -endif ifeq ($(CIRCUITPY_COUNTIO),1) SRC_PATTERNS += countio/% endif @@ -227,6 +224,9 @@ endif ifeq ($(CIRCUITPY_MATH),1) SRC_PATTERNS += math/% endif +ifeq ($(CIRCUITPY_MEMORYMAP),1) +SRC_PATTERNS += memorymap/% +endif ifeq ($(CIRCUITPY_MEMORYMONITOR),1) SRC_PATTERNS += memorymonitor/% endif @@ -400,7 +400,6 @@ SRC_COMMON_HAL_ALL = \ alarm/pin/PinAlarm.c \ alarm/time/TimeAlarm.c \ alarm/touch/TouchAlarm.c \ - alarm/coproc/CoprocAlarm.c \ analogbufio/BufferedIn.c \ analogbufio/__init__.c \ analogio/AnalogIn.c \ @@ -423,9 +422,6 @@ SRC_COMMON_HAL_ALL = \ canio/CAN.c \ canio/Listener.c \ canio/__init__.c \ - coproc/__init__.c \ - coproc/Coproc.c \ - coproc/CoprocMemory.c \ countio/Counter.c \ countio/__init__.c \ digitalio/DigitalInOut.c \ @@ -443,9 +439,11 @@ SRC_COMMON_HAL_ALL = \ hashlib/Hash.c \ i2ctarget/I2CTarget.c \ i2ctarget/__init__.c \ + memorymap/__init__.c \ + memorymap/AddressRange.c \ + microcontroller/__init__.c \ microcontroller/Pin.c \ microcontroller/Processor.c \ - microcontroller/__init__.c \ mdns/__init__.c \ mdns/Server.c \ mdns/RemoteService.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index f0e145998b..01b078c6e8 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -221,12 +221,15 @@ CFLAGS += -DCIRCUITPY_OS_GETENV=$(CIRCUITPY_OS_GETENV) CIRCUITPY_ERRNO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO) -# CIRCUITPY_ESPIDF is handled in the espressif tree. +# CIRCUITPY_ESPIDF and CIRCUITPY_ESPULP is handled in the espressif tree. # Only for ESP32S chips. # Assume not a ESP build. CIRCUITPY_ESPIDF ?= 0 CFLAGS += -DCIRCUITPY_ESPIDF=$(CIRCUITPY_ESPIDF) +CIRCUITPY_ESPULP ?= 0 +CFLAGS += -DCIRCUITPY_ESPULP=$(CIRCUITPY_ESPULP) + CIRCUITPY_ESP32_CAMERA ?= 0 CFLAGS += -DCIRCUITPY_ESP32_CAMERA=$(CIRCUITPY_ESP32_CAMERA) @@ -283,6 +286,9 @@ CFLAGS += -DCIRCUITPY_KEYPAD=$(CIRCUITPY_KEYPAD) CIRCUITPY_MATH ?= 1 CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) +CIRCUITPY_MEMORYMAP ?= 0 +CFLAGS += -DCIRCUITPY_MEMORYMAP=$(CIRCUITPY_MEMORYMAP) + CIRCUITPY_MEMORYMONITOR ?= 0 CFLAGS += -DCIRCUITPY_MEMORYMONITOR=$(CIRCUITPY_MEMORYMONITOR) diff --git a/shared-bindings/alarm/__init__.c b/shared-bindings/alarm/__init__.c index bd11b16996..48dccff8df 100644 --- a/shared-bindings/alarm/__init__.c +++ b/shared-bindings/alarm/__init__.c @@ -27,12 +27,15 @@ #include "py/obj.h" #include "py/runtime.h" +#if CIRCUITPY_ESPULP +#include "bindings/espulp/ULPAlarm.h" +#endif + #include "shared-bindings/alarm/__init__.h" #include "shared-bindings/alarm/SleepMemory.h" #include "shared-bindings/alarm/pin/PinAlarm.h" #include "shared-bindings/alarm/time/TimeAlarm.h" #include "shared-bindings/alarm/touch/TouchAlarm.h" -#include "shared-bindings/alarm/coproc/CoprocAlarm.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/supervisor/Runtime.h" #include "shared-bindings/time/__init__.h" @@ -77,8 +80,10 @@ STATIC void validate_objs_are_alarms(size_t n_args, const mp_obj_t *objs) { for (size_t i = 0; i < n_args; i++) { if (mp_obj_is_type(objs[i], &alarm_pin_pinalarm_type) || mp_obj_is_type(objs[i], &alarm_time_timealarm_type) || - mp_obj_is_type(objs[i], &alarm_touch_touchalarm_type) || - mp_obj_is_type(objs[i], &alarm_coproc_coprocalarm_type)) { + #if CIRCUITPY_ESPULP + mp_obj_is_type(objs[i], &espulp_ulpalarm_type) || + #endif + mp_obj_is_type(objs[i], &alarm_touch_touchalarm_type)) { continue; } mp_raise_TypeError_varg(translate("Expected an %q"), MP_QSTR_Alarm); @@ -256,18 +261,6 @@ STATIC const mp_obj_module_t alarm_touch_module = { .globals = (mp_obj_dict_t *)&alarm_touch_globals, }; -STATIC const mp_map_elem_t alarm_coproc_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_coproc) }, - { MP_ROM_QSTR(MP_QSTR_CoprocAlarm), MP_OBJ_FROM_PTR(&alarm_coproc_coprocalarm_type) }, -}; - -STATIC MP_DEFINE_CONST_DICT(alarm_coproc_globals, alarm_coproc_globals_table); - -STATIC const mp_obj_module_t alarm_coproc_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&alarm_coproc_globals, -}; - // The module table is mutable because .wake_alarm is a mutable attribute. STATIC mp_map_elem_t alarm_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_alarm) }, @@ -282,7 +275,6 @@ STATIC mp_map_elem_t alarm_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_pin), MP_OBJ_FROM_PTR(&alarm_pin_module) }, { MP_ROM_QSTR(MP_QSTR_time), MP_OBJ_FROM_PTR(&alarm_time_module) }, { MP_ROM_QSTR(MP_QSTR_touch), MP_OBJ_FROM_PTR(&alarm_touch_module) }, - { MP_ROM_QSTR(MP_QSTR_coproc), MP_OBJ_FROM_PTR(&alarm_coproc_module) }, { MP_ROM_QSTR(MP_QSTR_SleepMemory), MP_OBJ_FROM_PTR(&alarm_sleep_memory_type) }, { MP_ROM_QSTR(MP_QSTR_sleep_memory), MP_OBJ_FROM_PTR(&alarm_sleep_memory_obj) }, diff --git a/shared-bindings/alarm/coproc/CoprocAlarm.c b/shared-bindings/alarm/coproc/CoprocAlarm.c deleted file mode 100644 index 0b60282c2f..0000000000 --- a/shared-bindings/alarm/coproc/CoprocAlarm.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 microDev - * - * 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 "py/runtime.h" - -#if CIRCUITPY_COPROC -#include "shared-bindings/util.h" -#include "shared-bindings/alarm/coproc/CoprocAlarm.h" -#include "shared-bindings/coproc/Coproc.h" - -STATIC coproc_coproc_obj_t *get_coproc_obj(mp_obj_t *self_in) { - if (!mp_obj_is_type(*self_in, &coproc_coproc_type)) { - mp_raise_TypeError_varg(translate("Expected a %q"), MP_QSTR_Coproc); - } - coproc_coproc_obj_t *self = MP_OBJ_TO_PTR(*self_in); - if (common_hal_coproc_coproc_deinited(self)) { - raise_deinited_error(); - } - return self; -} -#endif - -//| class CoprocAlarm: -//| """Trigger an alarm when another core or co-processor requests wake-up.""" -//| -//| def __init__(self, coproc: coproc.Coproc) -> None: -//| """Create an alarm that will be triggered when the co-processor requests wake-up. -//| -//| The alarm is not active until it is passed to an `alarm`-enabling function, such as -//| `alarm.light_sleep_until_alarms()` or `alarm.exit_and_deep_sleep_until_alarms()`. -//| -//| :param coproc.Coproc coproc: The coproc program to run. -//| -//| """ -//| ... -//| -STATIC mp_obj_t alarm_coproc_coprocalarm_make_new(const mp_obj_type_t *type, - size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_coproc }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_coproc, MP_ARG_REQUIRED | MP_ARG_OBJ }, - }; - - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - #if CIRCUITPY_COPROC - // initialize CoprocAlarm object - alarm_coproc_coprocalarm_obj_t *self = m_new_obj(alarm_coproc_coprocalarm_obj_t); - self->base.type = &alarm_coproc_coprocalarm_type; - self->coproc = get_coproc_obj(&args[ARG_coproc].u_obj); - // return CoprocAlarm object - return MP_OBJ_FROM_PTR(self); - #else - mp_raise_NotImplementedError(NULL); - return mp_const_none; - #endif -} - -const mp_obj_type_t alarm_coproc_coprocalarm_type = { - { &mp_type_type }, - .name = MP_QSTR_CoprocAlarm, - .make_new = alarm_coproc_coprocalarm_make_new, -}; diff --git a/shared-bindings/coproc/Coproc.c b/shared-bindings/coproc/Coproc.c deleted file mode 100644 index 85595578c8..0000000000 --- a/shared-bindings/coproc/Coproc.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 microDev - * - * 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 "shared/runtime/context_manager_helpers.h" -#include "py/objproperty.h" -#include "py/runtime.h" - -#include "shared-bindings/coproc/Coproc.h" -#include "shared-bindings/coproc/CoprocMemory.h" - -STATIC coproc_memory_obj_t *get_coproc_memory_obj(mp_obj_t *self_in) { - if (!mp_obj_is_type(*self_in, &coproc_memory_type)) { - mp_raise_TypeError_varg(translate("Expected a %q"), MP_QSTR_CoprocMemory); - } - return MP_OBJ_TO_PTR(*self_in); -} - -//| class Coproc: -//| def __init__(self, buffer: ReadableBuffer, memory: CoprocMemory) -> None: -//| """Loads the program binary into memory. -//| -//| :param buffer: The program binary to run on the core/co-processor -//| :param memory: The `CoprocMemory` object used to access shared memory""" -STATIC mp_obj_t coproc_coproc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_buffer, ARG_memory }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_memory, MP_ARG_OBJ, { .u_obj = mp_const_none } }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - coproc_coproc_obj_t *self = m_new_obj(coproc_coproc_obj_t); - self->base.type = &coproc_coproc_type; - - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_READ); - - coproc_memory_obj_t *coproc_memory = (args[ARG_memory].u_obj == mp_const_none) ? NULL : get_coproc_memory_obj(&args[ARG_memory].u_obj); - - common_hal_coproc_coproc_construct(self, bufinfo.buf, bufinfo.len, coproc_memory); - - return MP_OBJ_FROM_PTR(self); -} - -//| def deinit(self) -> None: -//| """Releases control of the underlying hardware so other classes can use it.""" -//| ... -STATIC mp_obj_t coproc_coproc_obj_deinit(mp_obj_t self_in) { - coproc_coproc_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_coproc_coproc_deinit(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(coproc_coproc_deinit_obj, coproc_coproc_obj_deinit); - -//| def __enter__(self) -> Coproc: -//| """No-op used in Context Managers.""" -//| ... -// Provided by context manager helper. - -//| def __exit__(self) -> None: -//| """Close the request.""" -//| ... -//| -STATIC mp_obj_t coproc_coproc_obj___exit__(size_t n_args, const mp_obj_t *args) { - (void)n_args; - mp_check_self(mp_obj_is_type(args[0], &coproc_coproc_type)); - return coproc_coproc_obj_deinit(args[0]); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(coproc_coproc___exit___obj, 4, 4, coproc_coproc_obj___exit__); - -STATIC const mp_rom_map_elem_t coproc_coproc_locals_dict_table[] = { - // context managers - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&coproc_coproc___exit___obj) }, - - // functions - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&coproc_coproc_deinit_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(coproc_coproc_locals_dict, coproc_coproc_locals_dict_table); - -const mp_obj_type_t coproc_coproc_type = { - { &mp_type_type }, - .name = MP_QSTR_Coproc, - .make_new = coproc_coproc_make_new, - .locals_dict = (mp_obj_dict_t *)&coproc_coproc_locals_dict, -}; diff --git a/shared-bindings/coproc/CoprocMemory.h b/shared-bindings/coproc/CoprocMemory.h deleted file mode 100644 index fdbb2fa0fa..0000000000 --- a/shared-bindings/coproc/CoprocMemory.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 microDev - * - * 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. - */ - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_COPROC_COPROCMEMORY_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_COPROC_COPROCMEMORY_H - -#include "common-hal/coproc/CoprocMemory.h" - -extern const mp_obj_type_t coproc_memory_type; - -uint32_t common_hal_coproc_memory_get_length(coproc_memory_obj_t *self); - -bool common_hal_coproc_memory_set_bytes(coproc_memory_obj_t *self, uint32_t start_index, const uint8_t *values, uint32_t len); -void common_hal_coproc_memory_get_bytes(coproc_memory_obj_t *self, uint32_t start_index, uint8_t *values, uint32_t len); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_COPROC_COPROCMEMORY_H diff --git a/shared-bindings/coproc/__init__.c b/shared-bindings/coproc/__init__.c deleted file mode 100644 index 06b196d8be..0000000000 --- a/shared-bindings/coproc/__init__.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2022 microDev - * - * 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 "shared-bindings/util.h" -#include "shared-bindings/coproc/__init__.h" -#include "shared-bindings/coproc/Coproc.h" -#include "shared-bindings/coproc/CoprocMemory.h" - -#include "py/runtime.h" - -//| """COPROC Module -//| -//| The `coproc` module adds ability to load and run -//| programs on a co-processor or a different cpu core. -//| -//| .. code-block:: python -//| -//| import coproc -//| -//| shared_mem = coproc.CoprocMemory(address=0x500007fc, length=1024) -//| -//| with open("program.bin", "rb") as f: -//| program = coproc.Coproc(buffer=f.read(), memory=shared_mem) -//| -//| coproc.run(program) -//| print(coproc.memory(program)[0]) -//| # coproc.halt(program) -//| """ -//| ... -//| - -STATIC coproc_coproc_obj_t *get_coproc_obj(mp_obj_t *self_in) { - if (!mp_obj_is_type(*self_in, &coproc_coproc_type)) { - mp_raise_TypeError_varg(translate("Expected a %q"), MP_QSTR_Coproc); - } - coproc_coproc_obj_t *self = MP_OBJ_TO_PTR(*self_in); - if (common_hal_coproc_coproc_deinited(self)) { - raise_deinited_error(); - } - return self; -} - -//| def run(*coproc: Coproc) -> None: -//| """Runs the loaded program.""" -//| ... -//| -STATIC mp_obj_t coproc_run(mp_obj_t self_in) { - common_hal_coproc_run(get_coproc_obj(&self_in)); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(coproc_run_obj, coproc_run); - -//| def halt(*coproc: Coproc) -> None: -//| """Halts the loaded program.""" -//| ... -//| -STATIC mp_obj_t coproc_halt(mp_obj_t self_in) { - common_hal_coproc_halt(get_coproc_obj(&self_in)); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(coproc_halt_obj, coproc_halt); - -//| def memory(*coproc: Coproc) -> CoprocMemory: -//| """Returns the shared memory as a bytearray.""" -//| ... -//| -STATIC mp_obj_t coproc_memory(mp_obj_t self_in) { - return common_hal_coproc_memory(get_coproc_obj(&self_in)); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(coproc_memory_obj, coproc_memory); - -STATIC const mp_rom_map_elem_t coproc_module_globals_table[] = { - // module name - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_coproc) }, - - // module functions - { MP_ROM_QSTR(MP_QSTR_run), MP_ROM_PTR(&coproc_run_obj) }, - { MP_ROM_QSTR(MP_QSTR_halt), MP_ROM_PTR(&coproc_halt_obj) }, - { MP_ROM_QSTR(MP_QSTR_memory), MP_ROM_PTR(&coproc_memory_obj) }, - - // module classes - { MP_ROM_QSTR(MP_QSTR_Coproc), MP_OBJ_FROM_PTR(&coproc_coproc_type) }, - { MP_ROM_QSTR(MP_QSTR_CoprocMemory), MP_OBJ_FROM_PTR(&coproc_memory_type) }, -}; -STATIC MP_DEFINE_CONST_DICT(coproc_module_globals, coproc_module_globals_table); - -const mp_obj_module_t coproc_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&coproc_module_globals, -}; - -MP_REGISTER_MODULE(MP_QSTR_coproc, coproc_module, CIRCUITPY_COPROC); diff --git a/shared-bindings/coproc/CoprocMemory.c b/shared-bindings/memorymap/AddressRange.c similarity index 59% rename from shared-bindings/coproc/CoprocMemory.c rename to shared-bindings/memorymap/AddressRange.c index 0d49a2f008..511400d0af 100644 --- a/shared-bindings/coproc/CoprocMemory.c +++ b/shared-bindings/memorymap/AddressRange.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2022 microDev + * 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 @@ -28,45 +28,62 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "py/runtime0.h" - -#include "shared-bindings/coproc/CoprocMemory.h" +#include "shared-bindings/memorymap/AddressRange.h" #include "supervisor/shared/translate/translate.h" -//| class CoprocMemory: -//| def __init__(self, address: int, length: int) -> None: -//| """Initialize coproc shared memory. +//| class AddressRange: +//| r"""Presents a range of addresses as a bytearray. //| -//| :param address: address of shared memory -//| :param length: length of shared memory""" -STATIC mp_obj_t coproc_memory_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_address, ARG_length }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_address, MP_ARG_REQUIRED | MP_ARG_INT }, - { MP_QSTR_length, MP_ARG_REQUIRED | MP_ARG_INT }, - }; +//| The addresses may access memory or memory mapped peripherals. +//| +//| Some address ranges may be protected by CircuitPython to prevent errors. +//| An exception will be raised when constructing an AddressRange for an +//| invalid or protected address. +//| +//| Multiple AddressRanges may overlap. There is no "claiming" of addresses. +//| +//| Example usage on ESP32-S2:: +//| +//| import memorymap +//| rtc_slow_mem = memorymap.AddressRange(start=0x50000000, length=0x2000) +//| rtc_slow_mem[0:3] = b"\xcc\x10\x00" +//| """ +//| def __init__(self, *, start, length) -> None: +//| """Constructs an address range starting at ``start`` and ending at +//| ``start + length``. An exception will be raised if any of the +//| addresses are invalid or protected.""" +//| ... +STATIC mp_obj_t memorymap_addressrange_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { + enum { ARG_start, ARG_length }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_start, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_INT }, + { MP_QSTR_length, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_INT }, + }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - coproc_memory_obj_t *self = m_new_obj(coproc_memory_obj_t); - self->base.type = &coproc_memory_type; - self->address = args[ARG_address].u_int; - self->len = args[ARG_length].u_int; + size_t start = + mp_arg_validate_int_min(args[ARG_start].u_int, 0, MP_QSTR_start); + size_t length = + mp_arg_validate_int_min(args[ARG_length].u_int, 1, MP_QSTR_length); + + + memorymap_addressrange_obj_t *self = m_new_obj(memorymap_addressrange_obj_t); + self->base.type = &memorymap_addressrange_type; + + common_hal_memorymap_addressrange_construct(self, (uint8_t *)start, length); return MP_OBJ_FROM_PTR(self); } -//| def __bool__(self) -> bool: -//| """``coproc_memory`` is ``True`` if its length is greater than zero. -//| This is an easy way to check for its existence. -//| """ -//| ... +//| def __bool__(self) -> bool: ... //| def __len__(self) -> int: //| """Return the length. This is used by (`len`)""" //| ... -STATIC mp_obj_t coproc_memory_unary_op(mp_unary_op_t op, mp_obj_t self_in) { - coproc_memory_obj_t *self = MP_OBJ_TO_PTR(self_in); - uint16_t len = common_hal_coproc_memory_get_length(self); +STATIC mp_obj_t memorymap_addressrange_unary_op(mp_unary_op_t op, mp_obj_t self_in) { + memorymap_addressrange_obj_t *self = MP_OBJ_TO_PTR(self_in); + uint16_t len = common_hal_memorymap_addressrange_get_length(self); switch (op) { case MP_UNARY_OP_BOOL: return mp_obj_new_bool(len != 0); @@ -77,36 +94,42 @@ STATIC mp_obj_t coproc_memory_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -STATIC const mp_rom_map_elem_t coproc_memory_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t memorymap_addressrange_locals_dict_table[] = { }; -STATIC MP_DEFINE_CONST_DICT(coproc_memory_locals_dict, coproc_memory_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(memorymap_addressrange_locals_dict, memorymap_addressrange_locals_dict_table); //| @overload //| def __getitem__(self, index: slice) -> bytearray: ... //| @overload //| def __getitem__(self, index: int) -> int: -//| """Returns the value at the given index.""" +//| """Returns the value(s) at the given index. +//| +//| 1, 2, 4 and 8 byte reads will be done in one assignment. All others +//| will use memcpy.""" //| ... //| @overload //| def __setitem__(self, index: slice, value: ReadableBuffer) -> None: ... //| @overload //| def __setitem__(self, index: int, value: int) -> None: -//| """Set the value at the given index.""" +//| """Set the value(s) at the given index. +//| +//| 1, 2, 4 and 8 byte writes will be done in one assignment. All others +//| will use memcpy.""" //| ... //| -STATIC mp_obj_t coproc_memory_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { +STATIC mp_obj_t memorymap_addressrange_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { if (value == MP_OBJ_NULL) { // delete item // slice deletion return MP_OBJ_NULL; // op not supported } else { - coproc_memory_obj_t *self = MP_OBJ_TO_PTR(self_in); + memorymap_addressrange_obj_t *self = MP_OBJ_TO_PTR(self_in); if (0) { #if MICROPY_PY_BUILTINS_SLICE } else if (mp_obj_is_type(index_in, &mp_type_slice)) { mp_bound_slice_t slice; - if (!mp_seq_get_fast_slice_indexes(common_hal_coproc_memory_get_length(self), index_in, &slice)) { + if (!mp_seq_get_fast_slice_indexes(common_hal_memorymap_addressrange_get_length(self), index_in, &slice)) { mp_raise_NotImplementedError(translate("only slices with step=1 (aka None) are supported")); } if (value != MP_OBJ_SENTINEL) { @@ -132,8 +155,8 @@ STATIC mp_obj_t coproc_memory_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj mp_raise_NotImplementedError(translate("array/bytes required on right side")); } - if (!common_hal_coproc_memory_set_bytes(self, slice.start, src_items, src_len)) { - mp_raise_RuntimeError(translate("Unable to write")); + if (!common_hal_memorymap_addressrange_set_bytes(self, slice.start, src_items, src_len)) { + mp_raise_RuntimeError(translate("Unable to write to address.")); } return mp_const_none; #else @@ -143,18 +166,18 @@ STATIC mp_obj_t coproc_memory_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj // Read slice. size_t len = slice.stop - slice.start; uint8_t *items = m_new(uint8_t, len); - common_hal_coproc_memory_get_bytes(self, slice.start, items, len); + common_hal_memorymap_addressrange_get_bytes(self, slice.start, len, items); return mp_obj_new_bytearray_by_ref(len, items); } #endif } else { // Single index rather than slice. - size_t index = mp_get_index(self->base.type, common_hal_coproc_memory_get_length(self), + size_t index = mp_get_index(self->base.type, common_hal_memorymap_addressrange_get_length(self), index_in, false); if (value == MP_OBJ_SENTINEL) { // load uint8_t value_out; - common_hal_coproc_memory_get_bytes(self, index, &value_out, 1); + common_hal_memorymap_addressrange_get_bytes(self, index, 1, &value_out); return MP_OBJ_NEW_SMALL_INT(value_out); } else { // store @@ -162,8 +185,8 @@ STATIC mp_obj_t coproc_memory_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj mp_arg_validate_int_range(byte_value, 0, 255, MP_QSTR_bytes); uint8_t short_value = byte_value; - if (!common_hal_coproc_memory_set_bytes(self, index, &short_value, 1)) { - mp_raise_RuntimeError(translate("Unable to write")); + if (!common_hal_memorymap_addressrange_set_bytes(self, index, &short_value, 1)) { + mp_raise_RuntimeError(translate("Unable to write to address.")); } return mp_const_none; } @@ -171,14 +194,14 @@ STATIC mp_obj_t coproc_memory_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj } } -const mp_obj_type_t coproc_memory_type = { +const mp_obj_type_t memorymap_addressrange_type = { { &mp_type_type }, - .name = MP_QSTR_CoprocMemory, .flags = MP_TYPE_FLAG_EXTENDED, - .make_new = coproc_memory_make_new, - .locals_dict = (mp_obj_t)&coproc_memory_locals_dict, + .name = MP_QSTR_AddressRange, + .make_new = memorymap_addressrange_make_new, + .locals_dict = (mp_obj_t)&memorymap_addressrange_locals_dict, MP_TYPE_EXTENDED_FIELDS( - .subscr = coproc_memory_subscr, - .unary_op = coproc_memory_unary_op, + .subscr = memorymap_addressrange_subscr, + .unary_op = memorymap_addressrange_unary_op, ), }; diff --git a/ports/espressif/common-hal/coproc/CoprocMemory.c b/shared-bindings/memorymap/AddressRange.h similarity index 53% rename from ports/espressif/common-hal/coproc/CoprocMemory.c rename to shared-bindings/memorymap/AddressRange.h index ca9a82dbcf..74a214d949 100644 --- a/ports/espressif/common-hal/coproc/CoprocMemory.c +++ b/shared-bindings/memorymap/AddressRange.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2022 microDev + * 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 @@ -24,29 +24,23 @@ * THE SOFTWARE. */ -#include "shared-bindings/coproc/CoprocMemory.h" +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMAP_ADDRESSRANGE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMAP_ADDRESSRANGE_H -uint32_t common_hal_coproc_memory_get_length(coproc_memory_obj_t *self) { - return self->len; -} +#include "common-hal/memorymap/AddressRange.h" -bool common_hal_coproc_memory_set_bytes(coproc_memory_obj_t *self, - uint32_t start_index, const uint8_t *values, uint32_t len) { +extern const mp_obj_type_t memorymap_addressrange_type; - if (start_index + len > self->len) { - return false; - } +void common_hal_memorymap_addressrange_construct(memorymap_addressrange_obj_t *self, uint8_t *start_address, size_t length); - memcpy((uint8_t *)(self->address + start_index), values, len); - return true; -} +uint32_t common_hal_memorymap_addressrange_get_length(const memorymap_addressrange_obj_t *self); -void common_hal_coproc_memory_get_bytes(coproc_memory_obj_t *self, - uint32_t start_index, uint8_t *values, uint32_t len) { +bool common_hal_memorymap_addressrange_set_bytes(const memorymap_addressrange_obj_t *self, + uint32_t start_index, uint8_t *values, uint32_t len); - if (start_index + len > self->len) { - return; - } +// len and values are intentionally swapped to signify values is an output and +// also leverage the compiler to validate uses are expected. +void common_hal_memorymap_addressrange_get_bytes(const memorymap_addressrange_obj_t *self, + uint32_t start_index, uint32_t len, uint8_t *values); - memcpy(values, (uint8_t *)(self->address + start_index), len); -} +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMAP_ADDRESSRANGE_H diff --git a/shared-bindings/memorymap/__init__.c b/shared-bindings/memorymap/__init__.c new file mode 100644 index 0000000000..576c7f1e1d --- /dev/null +++ b/shared-bindings/memorymap/__init__.c @@ -0,0 +1,52 @@ +/* + * 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 "py/obj.h" +#include "py/mphal.h" +#include "py/runtime.h" + +#include "shared-bindings/memorymap/__init__.h" +#include "shared-bindings/memorymap/AddressRange.h" + +//| """Raw memory map access +//| +//| The `memorymap` module allows you to read and write memory addresses in the +//| address space seen from the processor running CircuitPython. It is usually +//| the physical address space. +//| """ +STATIC const mp_rom_map_elem_t memorymap_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_memorymap) }, + { MP_ROM_QSTR(MP_QSTR_AddressRange), MP_ROM_PTR(&memorymap_addressrange_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(memorymap_module_globals, memorymap_module_globals_table); + +const mp_obj_module_t memorymap_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&memorymap_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_memorymap, memorymap_module, CIRCUITPY_MEMORYMAP); diff --git a/shared-bindings/memorymap/__init__.h b/shared-bindings/memorymap/__init__.h new file mode 100644 index 0000000000..f4e6c51481 --- /dev/null +++ b/shared-bindings/memorymap/__init__.h @@ -0,0 +1,30 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#ifndef SHARED_BINDINGS_MEMORYMAP_H +#define SHARED_BINDINGS_MEMORYMAP_H + +#endif // SHARED_BINDINGS_MEMORYMAP_H diff --git a/supervisor/shared/reload.c b/supervisor/shared/reload.c index e1ae2e6764..4e351704f8 100644 --- a/supervisor/shared/reload.c +++ b/supervisor/shared/reload.c @@ -28,6 +28,7 @@ #include "py/mphal.h" #include "py/mpstate.h" +#include "supervisor/port.h" #include "supervisor/shared/reload.h" #include "supervisor/shared/tick.h" @@ -52,6 +53,7 @@ void reload_initiate(supervisor_run_reason_t run_reason) { MP_STATE_VM(sched_state) = MP_SCHED_PENDING; } #endif + port_wake_main_task(); } void autoreload_reset() { diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 35d5c46a94..c34c3b3c9f 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -246,6 +246,15 @@ void supervisor_web_workflow_status(void) { void supervisor_start_web_workflow(void) { #if CIRCUITPY_WEB_WORKFLOW && CIRCUITPY_WIFI && CIRCUITPY_OS_GETENV + // Skip starting the workflow if we're not starting from power on or reset. + const mcu_reset_reason_t reset_reason = common_hal_mcu_processor_get_reset_reason(); + if (reset_reason != RESET_REASON_POWER_ON && + reset_reason != RESET_REASON_RESET_PIN && + reset_reason != RESET_REASON_UNKNOWN && + reset_reason != RESET_REASON_SOFTWARE) { + return; + } + char ssid[33]; char password[64]; From 674f0402a9c8f1acc01b4bab397bf119a57a5583 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 19 Dec 2022 15:30:03 -0500 Subject: [PATCH 304/357] Fix ESP32 builds --- ports/espressif/common-hal/alarm/__init__.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/espressif/common-hal/alarm/__init__.h b/ports/espressif/common-hal/alarm/__init__.h index e0086ee61a..65cbf96c87 100644 --- a/ports/espressif/common-hal/alarm/__init__.h +++ b/ports/espressif/common-hal/alarm/__init__.h @@ -36,7 +36,9 @@ #endif typedef union { +#if CIRCUITPY_ESPULP espulp_ulpalarm_obj_t ulp_alarm; +#endif alarm_pin_pinalarm_obj_t pin_alarm; alarm_time_timealarm_obj_t time_alarm; alarm_touch_touchalarm_obj_t touch_alarm; From 0498b1d2ae79b44fca529a1a276c376110faaaf7 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 19 Dec 2022 15:51:34 -0500 Subject: [PATCH 305/357] Fix indent --- ports/espressif/common-hal/alarm/__init__.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/common-hal/alarm/__init__.h b/ports/espressif/common-hal/alarm/__init__.h index 65cbf96c87..02e27e9806 100644 --- a/ports/espressif/common-hal/alarm/__init__.h +++ b/ports/espressif/common-hal/alarm/__init__.h @@ -36,9 +36,9 @@ #endif typedef union { -#if CIRCUITPY_ESPULP + #if CIRCUITPY_ESPULP espulp_ulpalarm_obj_t ulp_alarm; -#endif + #endif alarm_pin_pinalarm_obj_t pin_alarm; alarm_time_timealarm_obj_t time_alarm; alarm_touch_touchalarm_obj_t touch_alarm; From b36d603cf3ed1a93459fd6da053da98f2a116293 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Mon, 19 Dec 2022 22:11:30 +0100 Subject: [PATCH 306/357] add GP25 as status LED on the Raspberry Pi Pico --- ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h index 4714241999..548af930ba 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h +++ b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h @@ -1,5 +1,7 @@ #define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico" #define MICROPY_HW_MCU_NAME "rp2040" +#define MICROPY_HW_LED_STATUS (&pin_GPIO25) + #define CIRCUITPY_BOARD_I2C (1) #define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}} From aa63fae0ae56a18e68aa692cc77a9ecdd891f74b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 20 Dec 2022 07:27:26 -0600 Subject: [PATCH 307/357] fix ports/unix builds besides coverage --- ports/unix/modos.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/unix/modos.c b/ports/unix/modos.c index deea3bfc91..6bed69c43a 100644 --- a/ports/unix/modos.c +++ b/ports/unix/modos.c @@ -56,6 +56,10 @@ #endif #endif +#if defined(MICROPY_UNIX_COVERAGE) +mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_); +#endif + STATIC mp_obj_t mod_os_urandom(mp_obj_t num) { mp_int_t n = mp_obj_get_int(num); vstr_t vstr; @@ -193,12 +197,13 @@ STATIC mp_obj_t mod_os_system(mp_obj_t cmd_in) { } MP_DEFINE_CONST_FUN_OBJ_1(mod_os_system_obj, mod_os_system); -mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_); STATIC mp_obj_t mod_os_getenv(mp_obj_t var_in) { + #if defined(MICROPY_UNIX_COVERAGE) mp_obj_t result = common_hal_os_getenv(mp_obj_str_get_str(var_in), mp_const_none); if (result != mp_const_none) { return result; } + #endif const char *s = getenv(mp_obj_str_get_str(var_in)); if (s == NULL) { return mp_const_none; From c16b42e9725e576da441b2a9734b0029cdadbdd8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 20 Dec 2022 11:00:13 -0500 Subject: [PATCH 308/357] Tweak arg checking and comments --- ports/espressif/bindings/espulp/ULP.c | 11 +++++++++-- ports/espressif/common-hal/espulp/ULP.c | 7 +++++-- shared-bindings/memorymap/AddressRange.c | 8 ++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ports/espressif/bindings/espulp/ULP.c b/ports/espressif/bindings/espulp/ULP.c index 6cd719277b..15af22dca8 100644 --- a/ports/espressif/bindings/espulp/ULP.c +++ b/ports/espressif/bindings/espulp/ULP.c @@ -56,7 +56,7 @@ STATIC espulp_ulp_obj_t *get_ulp_obj(mp_obj_t self_in) { } //| def deinit(self) -> None: -//| """Deinitialises the camera and releases all memory resources for reuse.""" +//| """Deinitialises the ULP and releases it for another program.""" //| ... STATIC mp_obj_t espulp_ulp_deinit(mp_obj_t self_in) { espulp_ulp_obj_t *self = get_ulp_obj(self_in); @@ -104,12 +104,19 @@ STATIC mp_obj_t espulp_ulp_run(size_t n_args, const mp_obj_t *pos_args, mp_map_t mp_obj_t pins_in = args[ARG_pins].u_obj; const size_t num_pins = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(pins_in)); + + // The ULP only supports 21 pins on the ESP32-S2 and S3. So we can store it + // as a bitmask in a 32 bit number. The common-hal code does further checks. uint32_t pin_mask = 0; for (mp_uint_t i = 0; i < num_pins; i++) { mp_obj_t pin_obj = mp_obj_subscr(pins_in, MP_OBJ_NEW_SMALL_INT(i), MP_OBJ_SENTINEL); validate_obj_is_free_pin(pin_obj); - pin_mask |= 1 << ((const mcu_pin_obj_t *)pin_obj)->number; + const mcu_pin_obj_t *pin = ((const mcu_pin_obj_t *)pin_obj); + if (pin->number >= 32) { + raise_ValueError_invalid_pin(); + } + pin_mask |= 1 << pin->number; } common_hal_espulp_ulp_run(self, bufinfo.buf, bufinfo.len, pin_mask); diff --git a/ports/espressif/common-hal/espulp/ULP.c b/ports/espressif/common-hal/espulp/ULP.c index 8f80b5c9ec..4d30a94dfc 100644 --- a/ports/espressif/common-hal/espulp/ULP.c +++ b/ports/espressif/common-hal/espulp/ULP.c @@ -61,7 +61,7 @@ void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t } if (pin_mask >= (1 << 22)) { - mp_raise_ValueError(translate("Pins 21+ not supported from ULP")); + raise_ValueError_invalid_pin(); } for (uint8_t i = 0; i < 32; i++) { @@ -89,7 +89,7 @@ void common_hal_espulp_ulp_halt(espulp_ulp_obj_t *self) { // ulp_riscv_timer_stop(); // ulp_riscv_halt(); - // stop the ulp timer so that is doesn't restart the cpu + // stop the ulp timer so that it doesn't restart the cpu CLEAR_PERI_REG_MASK(RTC_CNTL_ULP_CP_TIMER_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN); // suspends the ulp operation @@ -107,6 +107,9 @@ void common_hal_espulp_ulp_halt(espulp_ulp_obj_t *self) { } void common_hal_espulp_ulp_construct(espulp_ulp_obj_t *self) { + // Use a static variable to track ULP in use so that subsequent code runs can + // use a running ULP. This is only to prevent multiple portions of user code + // from using the ULP concurrently. if (ulp_used) { mp_raise_ValueError_varg(translate("%q in use"), MP_QSTR_ULP); } diff --git a/shared-bindings/memorymap/AddressRange.c b/shared-bindings/memorymap/AddressRange.c index 511400d0af..fb55c07efe 100644 --- a/shared-bindings/memorymap/AddressRange.c +++ b/shared-bindings/memorymap/AddressRange.c @@ -105,8 +105,8 @@ STATIC MP_DEFINE_CONST_DICT(memorymap_addressrange_locals_dict, memorymap_addres //| def __getitem__(self, index: int) -> int: //| """Returns the value(s) at the given index. //| -//| 1, 2, 4 and 8 byte reads will be done in one assignment. All others -//| will use memcpy.""" +//| 1, 2, 4 and 8 byte aligned reads will be done in one transaction. +//| All others may use multiple transactions.""" //| ... //| @overload //| def __setitem__(self, index: slice, value: ReadableBuffer) -> None: ... @@ -114,8 +114,8 @@ STATIC MP_DEFINE_CONST_DICT(memorymap_addressrange_locals_dict, memorymap_addres //| def __setitem__(self, index: int, value: int) -> None: //| """Set the value(s) at the given index. //| -//| 1, 2, 4 and 8 byte writes will be done in one assignment. All others -//| will use memcpy.""" +//| 1, 2, 4 and 8 byte aligned writes will be done in one transaction. +//| All others may use multiple transactions.""" //| ... //| STATIC mp_obj_t memorymap_addressrange_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { From 826116879bcbdf03fb2df8ef86b9502ba77166fc Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 21 Dec 2022 02:43:15 +0100 Subject: [PATCH 309/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 42 +++++++++++++++++++++++------------ locale/cs.po | 42 +++++++++++++++++++++++------------ locale/de_DE.po | 47 +++++++++++++++++++++++++++------------- locale/el.po | 42 +++++++++++++++++++++++------------ locale/en_GB.po | 42 +++++++++++++++++++++++------------ locale/es.po | 42 +++++++++++++++++++++++------------ locale/fil.po | 42 +++++++++++++++++++++++------------ locale/fr.po | 47 +++++++++++++++++++++++++++------------- locale/hi.po | 42 +++++++++++++++++++++++------------ locale/it_IT.po | 42 +++++++++++++++++++++++------------ locale/ja.po | 42 +++++++++++++++++++++++------------ locale/ko.po | 42 +++++++++++++++++++++++------------ locale/nl.po | 42 +++++++++++++++++++++++------------ locale/pl.po | 42 +++++++++++++++++++++++------------ locale/pt_BR.po | 47 +++++++++++++++++++++++++++------------- locale/ru.po | 42 +++++++++++++++++++++++------------ locale/sv.po | 47 +++++++++++++++++++++++++++------------- locale/tr.po | 42 +++++++++++++++++++++++------------ locale/zh_Latn_pinyin.po | 47 +++++++++++++++++++++++++++------------- 19 files changed, 552 insertions(+), 271 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 6551a3253f..3aaca9e203 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -106,6 +106,7 @@ msgstr "%q berisi pin duplikat" msgid "%q failure: %d" msgstr "%q gagal: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -186,7 +187,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -399,6 +399,10 @@ msgstr "ADC2 sedang digunakan oleh WiFi" msgid "Address must be %d bytes long" msgstr "Alamat harus sepanjang %d byte" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -479,7 +483,7 @@ msgstr "Sudah disebarkan." msgid "Already have all-matches listener" msgstr "" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -503,7 +507,7 @@ msgstr "Send yang lain sudah aktif" msgid "Array must contain halfwords (type 'H')" msgstr "Array harus mengandung halfwords (ketik 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Nilai array harus berupa byte tunggal." @@ -927,10 +931,10 @@ msgstr "Error pada regex" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Diharapkan %q" @@ -1033,7 +1037,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1648,11 +1651,14 @@ msgstr "" "Hanya monokrom, 4bpp atau 8bpp yang diindeks, dan 16bpp atau lebih yang " "didukung: %d bpp diberikan" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1773,6 +1779,10 @@ msgstr "" "ideal. Jika ini tidak dapat dihindari, berikan allow_inefficient=True ke " "konstruktor" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Pin harus berurutan" @@ -1819,6 +1829,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull tidak digunakan saat arah output." @@ -1965,7 +1979,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Potongan dan nilai panjangnya berbeda." @@ -2239,8 +2253,8 @@ msgstr "Tidak dapat membaca data palet warna" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2498,7 +2512,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "diperlukan array/byte di sisi kanan" @@ -3757,7 +3771,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 7e550d8140..5010b8b862 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -107,6 +107,7 @@ msgstr "%q obsahuje duplicitní piny" msgid "%q failure: %d" msgstr "%q: selhání %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -187,7 +188,6 @@ msgstr "%q je mimo hranice" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -400,6 +400,10 @@ msgstr "WiFi používá ADC2" msgid "Address must be %d bytes long" msgstr "Adresa musí být %d bajtů dlouhá" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Všechny CAN periferie jsou používány" @@ -480,7 +484,7 @@ msgstr "Již propagujeme." msgid "Already have all-matches listener" msgstr "" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -504,7 +508,7 @@ msgstr "Další odesílání je již aktivní" msgid "Array must contain halfwords (type 'H')" msgstr "Pole musí obsahovat poloviční slova (typ „H“)" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Hodnoty pole by měly být jednoduché bajty." @@ -925,10 +929,10 @@ msgstr "Chyba v regulárním výrazu" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Očekává se %q" @@ -1031,7 +1035,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1644,11 +1647,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1764,6 +1770,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1810,6 +1820,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1954,7 +1968,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -2228,8 +2242,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2485,7 +2499,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -3743,7 +3757,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index f587d384a1..3f1d800592 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -108,6 +108,7 @@ msgstr "%q enthält doppelte Pins" msgid "%q failure: %d" msgstr "%q Fehler: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -189,7 +190,6 @@ msgstr "%q außerhalb der Grenzen" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -403,6 +403,10 @@ msgstr "ADC2 wird vom WiFi benutzt" msgid "Address must be %d bytes long" msgstr "Die Adresse muss %d Bytes lang sein" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Alle CAN-Schnittstellen sind in Benutzung" @@ -483,7 +487,7 @@ msgstr "Bereits am Anbieten (advertising)." msgid "Already have all-matches listener" msgstr "All-Matchers-Listener bereits vorhanden" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -507,7 +511,7 @@ msgstr "Ein anderer Sendevorgang ist schon aktiv" msgid "Array must contain halfwords (type 'H')" msgstr "Array muss Halbwörter enthalten (type 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Array-Werte sollten aus Einzelbytes bestehen." @@ -933,10 +937,10 @@ msgstr "Fehler in regex" msgid "Error: Failure to bind" msgstr "Error: Bind Fehler" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Erwartet ein(e) %q" @@ -1040,7 +1044,6 @@ msgstr "Die Firmware ist doppelt vorhanden" msgid "Firmware is invalid" msgstr "Die Firmware ist ungültig" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "Die Firmware ist zu groß" @@ -1665,11 +1668,14 @@ msgstr "" "Nur monochrome, indizierte 4bpp oder 8bpp, und 16bpp oder größere BMPs " "unterstützt: %d bpp wurden gegeben" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "Nur ein %q kann im Deep-Sleep gesetzt werden." +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1788,6 +1794,10 @@ msgstr "" "Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergib " "allow_inefficient=True an den Konstruktor" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Pins müssen geordnet sein" @@ -1835,6 +1845,10 @@ msgstr "Programm macht OUT ohne Laden von OSR" msgid "Program size invalid" msgstr "Programm-Größe ist ungültig" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." @@ -1979,7 +1993,7 @@ msgstr "Größe nicht unterstützt" msgid "Sleep Memory not available" msgstr "Sleep-Speicher nicht verfügbar" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice und Wert (value) haben unterschiedliche Längen." @@ -2267,9 +2281,9 @@ msgstr "Konnte Farbpalettendaten nicht lesen" msgid "Unable to start mDNS query" msgstr "mDNS-Abfrage kann nicht gestartet werden" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" -msgstr "Schreiben nicht möglich" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." +msgstr "" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2540,7 +2554,7 @@ msgid "array has too many dimensions" msgstr "Das Array hat zu viele Dimensionen" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "Array/Bytes auf der rechten Seite erforderlich" @@ -3822,7 +3836,7 @@ msgid "only sample_rate=16000 is supported" msgstr "nur eine sample_rate=16000 wird unterstützt" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" @@ -4424,6 +4438,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 "Unable to write" +#~ msgstr "Schreiben nicht möglich" + #~ msgid "%q length must be >= 1" #~ msgstr "%q Länge muss >= 1 sein" diff --git a/locale/el.po b/locale/el.po index 7b4e3f2001..e022e3a90e 100644 --- a/locale/el.po +++ b/locale/el.po @@ -112,6 +112,7 @@ msgstr "%q περιέχει διπλότυπα pins" msgid "%q failure: %d" msgstr "%q αποτυχία: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -192,7 +193,6 @@ msgstr "%q εκτός ορίων" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -406,6 +406,10 @@ msgstr "Το ADC2 χρησιμοποιείται απο το WIFI" msgid "Address must be %d bytes long" msgstr "Η διεύθυνση πρέπει να είναι %d bytes μεγάλη" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Όλα τα περιφεριακά CAN είναι σε χρήση" @@ -486,7 +490,7 @@ msgstr "Ήδη διαφημίζουμε." msgid "Already have all-matches listener" msgstr "Ύπάρχει ήδη all-matches ακροατής" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -510,7 +514,7 @@ msgstr "Άλλη αποστολή είναι ήδη ενεργή" msgid "Array must contain halfwords (type 'H')" msgstr "H παράταξη πρέπει να περιέχει halfwords (τύπου 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Η τιμές της παράταξη πρέπει να είναι μονά bytes." @@ -939,10 +943,10 @@ msgstr "" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "" @@ -1045,7 +1049,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1653,11 +1656,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1773,6 +1779,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1819,6 +1829,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1963,7 +1977,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -2237,8 +2251,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2494,7 +2508,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -3752,7 +3766,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 8c97dbb7e2..0f166288bf 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -110,6 +110,7 @@ msgstr "%q contains duplicate pins" msgid "%q failure: %d" msgstr "%q failure: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -190,7 +191,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -403,6 +403,10 @@ msgstr "ADC2 is being used by WiFi" msgid "Address must be %d bytes long" msgstr "Address must be %d bytes long" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "All CAN peripherals are in use" @@ -483,7 +487,7 @@ msgstr "Already advertising." msgid "Already have all-matches listener" msgstr "Already have all-matches listener" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -507,7 +511,7 @@ msgstr "Another send is already active" msgid "Array must contain halfwords (type 'H')" msgstr "Array must contain halfwords (type 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Array values should be single bytes." @@ -928,10 +932,10 @@ msgstr "Error in regex" msgid "Error: Failure to bind" msgstr "Error: Failure to bind" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Expected a %q" @@ -1034,7 +1038,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1648,11 +1651,14 @@ msgstr "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1772,6 +1778,10 @@ msgstr "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Pins must be sequential" @@ -1816,6 +1826,10 @@ msgstr "Program does OUT without loading OSR" msgid "Program size invalid" msgstr "Program size invalid" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull not used when direction is output." @@ -1960,7 +1974,7 @@ msgstr "Size not supported" msgid "Sleep Memory not available" msgstr "Sleep Memory not available" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice and value different lengths." @@ -2241,8 +2255,8 @@ msgstr "Unable to read colour palette data" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2501,7 +2515,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes required on right side" @@ -3762,7 +3776,7 @@ msgid "only sample_rate=16000 is supported" msgstr "only sample_rate=16000 is supported" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "only slices with step=1 (aka None) are supported" diff --git a/locale/es.po b/locale/es.po index 01f73ffd86..dd420bbd2e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -112,6 +112,7 @@ msgstr "%q contiene pines duplicados" msgid "%q failure: %d" msgstr "%q fallo: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -192,7 +193,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -405,6 +405,10 @@ msgstr "ADC2 está siendo usado por WiFi" msgid "Address must be %d bytes long" msgstr "La dirección debe tener %d bytes de largo" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Todos los periféricos CAN están en uso" @@ -487,7 +491,7 @@ msgstr "Ya se encuentra publicando." msgid "Already have all-matches listener" msgstr "Ya se tiene un escucha de todas las coincidencias" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -511,7 +515,7 @@ msgstr "Otro envío ya está activo" msgid "Array must contain halfwords (type 'H')" msgstr "El array debe contener medias palabras (escriba 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Valores del array deben ser bytes individuales." @@ -938,10 +942,10 @@ msgstr "Error en regex" msgid "Error: Failure to bind" msgstr "Error: fallo al vincular" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Se espera un %q" @@ -1044,7 +1048,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1672,11 +1675,14 @@ msgstr "" "Solo se admiten BMP monocromáticos, indexados de 4 bpp u 8 bpp y 16 bpp o " "más: %d bpp proporcionados" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1797,6 +1803,10 @@ msgstr "" "ideales. Si esto no se puede evitar, pase allow_inefficient=True al " "constructor" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Los pines deben estar en orden secuencial" @@ -1844,6 +1854,10 @@ msgstr "El programa hace OUT sin cargar OSR" msgid "Program size invalid" msgstr "El tamaño del programa no es correcto" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." @@ -1989,7 +2003,7 @@ msgstr "Sin capacidades para el tamaño" msgid "Sleep Memory not available" msgstr "Memoria de sueño no disponible" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice y value tienen tamaños diferentes." @@ -2273,8 +2287,8 @@ msgstr "No se pudo leer los datos de la paleta de colores" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2537,7 +2551,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes requeridos en el lado derecho" @@ -3809,7 +3823,7 @@ msgid "only sample_rate=16000 is supported" msgstr "solo se admite sample_rate=16000" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" diff --git a/locale/fil.po b/locale/fil.po index a4255383bd..7844d12562 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -101,6 +101,7 @@ msgstr "" msgid "%q failure: %d" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -181,7 +182,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -395,6 +395,10 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "ang palette ay dapat 32 bytes ang haba" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -476,7 +480,7 @@ msgstr "" msgid "Already have all-matches listener" msgstr "" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -500,7 +504,7 @@ msgstr "Isa pang send ay aktibo na" msgid "Array must contain halfwords (type 'H')" msgstr "May halfwords (type 'H') dapat ang array" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Array values ay dapat single bytes." @@ -924,10 +928,10 @@ msgstr "May pagkakamali sa REGEX" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Umasa ng %q" @@ -1030,7 +1034,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1643,11 +1646,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1764,6 +1770,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1808,6 +1818,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." @@ -1953,7 +1967,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice at value iba't ibang haba." @@ -2227,8 +2241,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2486,7 +2500,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes kinakailangan sa kanang bahagi" @@ -3761,7 +3775,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" diff --git a/locale/fr.po b/locale/fr.po index 1b31a9dcce..0f0afce8ff 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -112,6 +112,7 @@ msgstr "%q contient des broches en double" msgid "%q failure: %d" msgstr "Échec de %q : %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -192,7 +193,6 @@ msgstr "%q est hors limites" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -405,6 +405,10 @@ msgstr "ADC2 est utilisé pars le Wifi" msgid "Address must be %d bytes long" msgstr "L'adresse doit être longue de %d octets" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tous les périphériques CAN sont utilisés" @@ -485,7 +489,7 @@ msgstr "S'annonce déjà." msgid "Already have all-matches listener" msgstr "Il y a déjà un auditeur all-matches" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -509,7 +513,7 @@ msgstr "Un autre envoi est déjà actif" msgid "Array must contain halfwords (type 'H')" msgstr "La matrice doit contenir des demi-mots (type 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Les valeurs de la matrice doivent être des octets singuliers." @@ -948,10 +952,10 @@ msgstr "Erreur dans l'expression régulière" msgid "Error: Failure to bind" msgstr "Erreur : Impossible de lier" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Attendu un %q" @@ -1055,7 +1059,6 @@ msgstr "Le logiciel est identique" msgid "Firmware is invalid" msgstr "Logiciel invalide" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "Logiciel trop volumineux" @@ -1692,11 +1695,14 @@ msgstr "" "Seulement les BMP monochromes, 4 bpp ou 8 bpp, ou 16 bpp et plus sont " "supportés: %d bpp fournis" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "Une seul %q autorisée en sommeil profond." +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1817,6 +1823,10 @@ msgstr "" "octets idéal. Si cela ne peut pas être évité, transmettez allow_inefficient " "= True au constructeur" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Les broches doivent être séquentielles" @@ -1865,6 +1875,10 @@ msgstr "Le programme fait des sorties sans charger d'OSR" msgid "Program size invalid" msgstr "Taille du programme invalide" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." @@ -2009,7 +2023,7 @@ msgstr "Taille n'est pas supportée" msgid "Sleep Memory not available" msgstr "La mémoire de sommeil n'est pas disponible" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Tranche et valeur de tailles différentes." @@ -2298,9 +2312,9 @@ msgstr "Impossible de lire les données de la palette de couleurs" msgid "Unable to start mDNS query" msgstr "Impossible de lancer la requête mDNS" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" -msgstr "Écriture impossible" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." +msgstr "" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2569,7 +2583,7 @@ msgid "array has too many dimensions" msgstr "la tableau à trop de dimensions" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "matrice/octets requis à la droite" @@ -3852,7 +3866,7 @@ msgid "only sample_rate=16000 is supported" msgstr "seul sample_rate = 16000 est pris en charge" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" @@ -4452,6 +4466,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 "Unable to write" +#~ msgstr "Écriture impossible" + #~ msgid "%q length must be >= 1" #~ msgstr "La longueur de %q doit être >= 1" diff --git a/locale/hi.po b/locale/hi.po index 3b7e9f26d4..7243d82e75 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -100,6 +100,7 @@ msgstr "" msgid "%q failure: %d" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -180,7 +181,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -393,6 +393,10 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -473,7 +477,7 @@ msgstr "" msgid "Already have all-matches listener" msgstr "" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -497,7 +501,7 @@ msgstr "" msgid "Array must contain halfwords (type 'H')" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "" @@ -914,10 +918,10 @@ msgstr "" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "" @@ -1020,7 +1024,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1628,11 +1631,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1748,6 +1754,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1792,6 +1802,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1936,7 +1950,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -2210,8 +2224,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2467,7 +2481,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -3725,7 +3739,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index d21b120e58..401a9b9848 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -107,6 +107,7 @@ msgstr "" msgid "%q failure: %d" msgstr "%q fallito: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -187,7 +188,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -401,6 +401,10 @@ msgstr "ADC2 sta usando il WiFi" msgid "Address must be %d bytes long" msgstr "L'indirizzo deve essere lungo %d byte" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tutte le periferiche CAN sono in uso" @@ -482,7 +486,7 @@ msgstr "" msgid "Already have all-matches listener" msgstr "Già in possesso di tutti i listener abbinati" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -506,7 +510,7 @@ msgstr "Another send è gia activato" msgid "Array must contain halfwords (type 'H')" msgstr "Array deve avere mezzoparole (typo 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "I valori dell'Array dovrebbero essere bytes singoli." @@ -929,10 +933,10 @@ msgstr "Errore nella regex" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Atteso un %q" @@ -1035,7 +1039,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1650,11 +1653,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1773,6 +1779,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1818,6 +1828,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1963,7 +1977,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -2237,8 +2251,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2496,7 +2510,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -3772,7 +3786,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" diff --git a/locale/ja.po b/locale/ja.po index 124bb762af..0c099d26c3 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -105,6 +105,7 @@ msgstr "" msgid "%q failure: %d" msgstr "%q 失敗: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -185,7 +186,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -398,6 +398,10 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "アドレスは、%dバイト長でなければなりません" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "全てのCAN周辺機器が使用中" @@ -478,7 +482,7 @@ msgstr "すでにアドバータイズ中" msgid "Already have all-matches listener" msgstr "" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -502,7 +506,7 @@ msgstr "他のsendがすでにアクティブ" msgid "Array must contain halfwords (type 'H')" msgstr "array のタイプは16ビット ('H') でなければなりません" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Arrayの各値は1バイトでなければなりません" @@ -923,10 +927,10 @@ msgstr "正規表現にエラーがあります" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "%qが必要" @@ -1029,7 +1033,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1641,11 +1644,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1761,6 +1767,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1805,6 +1815,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "方向がoutputのときpullは使われません" @@ -1949,7 +1963,7 @@ msgstr "サイズは対応していません" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "スライスと値の長さが一致しません" @@ -2224,8 +2238,8 @@ msgstr "カラーパレットデータを読み込めません" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2481,7 +2495,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "右辺にはarray/bytesが必要" @@ -3744,7 +3758,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index fda78fbd95..83832d31ef 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -101,6 +101,7 @@ msgstr "" msgid "%q failure: %d" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -181,7 +182,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -394,6 +394,10 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -474,7 +478,7 @@ msgstr "" msgid "Already have all-matches listener" msgstr "" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -498,7 +502,7 @@ msgstr "" msgid "Array must contain halfwords (type 'H')" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "" @@ -917,10 +921,10 @@ msgstr "Regex에 오류가 있습니다." msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "%q 이 예상되었습니다." @@ -1023,7 +1027,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1631,11 +1634,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1751,6 +1757,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1795,6 +1805,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1939,7 +1953,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -2214,8 +2228,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2471,7 +2485,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -3729,7 +3743,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 2bdb6e8a4c..f639bcec2a 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -103,6 +103,7 @@ msgstr "" msgid "%q failure: %d" msgstr "%q fout: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -183,7 +184,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -396,6 +396,10 @@ msgstr "ADC2 wordt gebruikt door WiFi" msgid "Address must be %d bytes long" msgstr "Adres moet %d bytes lang zijn" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Alle CAN-peripherals zijn in gebruik" @@ -476,7 +480,7 @@ msgstr "Advertising is al bezig." msgid "Already have all-matches listener" msgstr "Heeft al een luisteraar voor 'all-matches'" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -500,7 +504,7 @@ msgstr "Een andere send is al actief" msgid "Array must contain halfwords (type 'H')" msgstr "Array moet halfwords (type 'H') bevatten" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Array waardes moet enkele bytes zijn." @@ -922,10 +926,10 @@ msgstr "Fout in regex" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Verwacht een %q" @@ -1028,7 +1032,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1645,11 +1648,14 @@ msgstr "" "Alleen monochrome en 4bpp of 8bpp, en 16bpp of grotere geïndiceerde BMP's " "zijn ondersteund: %d bpp is gegeven" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1770,6 +1776,10 @@ msgstr "" "gebruikt. Als dit niet kan worden vermeden, geef dan het argument " "allow_inefficient=True aan de constructor" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1816,6 +1826,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull niet gebruikt wanneer de richting output is." @@ -1960,7 +1974,7 @@ msgstr "Afmeting niet ondersteund" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice en waarde hebben verschillende lengtes." @@ -2234,8 +2248,8 @@ msgstr "Niet in staat kleurenpalet data te lezen" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2497,7 +2511,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes vereist aan de rechterkant" @@ -3762,7 +3776,7 @@ msgid "only sample_rate=16000 is supported" msgstr "alleen sample_rate=16000 wordt ondersteund" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "alleen segmenten met step=1 (ook wel None) worden ondersteund" diff --git a/locale/pl.po b/locale/pl.po index b399da6db1..39853c1ddf 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -105,6 +105,7 @@ msgstr "" msgid "%q failure: %d" msgstr "%q niepowodzenie: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -185,7 +186,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -398,6 +398,10 @@ msgstr "ADC2 jest używany przez WiFi" msgid "Address must be %d bytes long" msgstr "Adres musi mieć %d bajtów" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" @@ -478,7 +482,7 @@ msgstr "" msgid "Already have all-matches listener" msgstr "" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -502,7 +506,7 @@ msgstr "Wysyłanie jest już w toku" msgid "Array must contain halfwords (type 'H')" msgstr "Tablica musi zawierać pół-słowa (typ 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Wartości powinny być bajtami." @@ -923,10 +927,10 @@ msgstr "Błąd w regex" msgid "Error: Failure to bind" msgstr "" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Oczekiwano %q" @@ -1029,7 +1033,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "" @@ -1639,11 +1642,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1759,6 +1765,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1803,6 +1813,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." @@ -1947,7 +1961,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Fragment i wartość są różnych długości." @@ -2221,8 +2235,8 @@ msgstr "Nie można odczytać danych palety" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2478,7 +2492,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "tablica/bytes wymagane po prawej stronie" @@ -3737,7 +3751,7 @@ msgid "only sample_rate=16000 is supported" msgstr "obsługiwane jest tylko sample_rate=16000" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index c0e64fd9dc..4a95e608d4 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -109,6 +109,7 @@ msgstr "%q contém pinos duplicados" msgid "%q failure: %d" msgstr "%q falha: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -189,7 +190,6 @@ msgstr "%q fora dos limites" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -406,6 +406,10 @@ msgstr "O ADC2 está sendo usado pelo WiFi" msgid "Address must be %d bytes long" msgstr "O endereço deve ter %d bytes de comprimento" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Todos os periféricos CAN estão em uso" @@ -486,7 +490,7 @@ msgstr "Já está anunciando." msgid "Already have all-matches listener" msgstr "Já há um ouvinte com todas as correspondências" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -510,7 +514,7 @@ msgstr "Outro envio já está ativo" msgid "Array must contain halfwords (type 'H')" msgstr "Array deve conter meias palavras (tipo 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Os valores das matrizes devem ser bytes simples." @@ -941,10 +945,10 @@ msgstr "Erro no regex" msgid "Error: Failure to bind" msgstr "Erro: Falha na vinculação" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Esperado um" @@ -1047,7 +1051,6 @@ msgstr "O firmware está duplicado" msgid "Firmware is invalid" msgstr "O firmware é inválido" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "O firmware é muito grande" @@ -1674,11 +1677,14 @@ msgstr "" "São compatíveis apenas os BMPs monocromáticos, indexados em 4bpp ou 8bpp e " "16bpp ou superior: determinado %d bpp" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "Apenas um %q pode ser colocado em hibernação profunda." +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1799,6 +1805,10 @@ msgstr "" "ideal. Caso isso não possa ser evitado, passe allow_inefficient=True ao " "construtor" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Os pinos devem ser sequenciais" @@ -1848,6 +1858,10 @@ msgstr "O programa faz OUT sem carregar o OSR" msgid "Program size invalid" msgstr "O tamanho do programa é inválido" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "O Pull não foi usado quando a direção for gerada." @@ -1992,7 +2006,7 @@ msgstr "O tamanho não é suportado" msgid "Sleep Memory not available" msgstr "Sleep memory não está disponível" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Fatie e avalie os diferentes comprimentos." @@ -2280,9 +2294,9 @@ msgstr "Não foi possível ler os dados da paleta de cores" msgid "Unable to start mDNS query" msgstr "Não é possível iniciar a consulta mDNS" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" -msgstr "Não é possível escrever" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." +msgstr "" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2550,7 +2564,7 @@ msgid "array has too many dimensions" msgstr "a matriz possui muitas dimensões" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "matriz/bytes são necessários no lado direito" @@ -3825,7 +3839,7 @@ msgid "only sample_rate=16000 is supported" msgstr "apenas sample_rate = 16000 é compatível" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" @@ -4427,6 +4441,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 "Unable to write" +#~ msgstr "Não é possível escrever" + #~ msgid "%q length must be >= 1" #~ msgstr "o comprimento %q deve ser >=1" diff --git a/locale/ru.po b/locale/ru.po index 014adb5f94..ef8dc019b4 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -111,6 +111,7 @@ msgstr "%q содержит пины-дупликаты" msgid "%q failure: %d" msgstr "%q сбой: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -191,7 +192,6 @@ msgstr "%q за пределом" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -404,6 +404,10 @@ msgstr "ADC2 используется WiFi" msgid "Address must be %d bytes long" msgstr "Адрес должен быть длиной %d байт" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Все периферийные устройства CAN уже используются" @@ -484,7 +488,7 @@ msgstr "Уже объявляемся (advertising)." msgid "Already have all-matches listener" msgstr "Уже есть универсальный слушатель" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -508,7 +512,7 @@ msgstr "Другая передача уже активна" msgid "Array must contain halfwords (type 'H')" msgstr "Массив должен содержать полуслова (тип 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Значения массива должны быть однобайтовыми." @@ -945,10 +949,10 @@ msgstr "Ошибка в регулярном выражении(regex)" msgid "Error: Failure to bind" msgstr "Ошибка: Сбой привязки" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Ожидалось(ся) %q" @@ -1054,7 +1058,6 @@ msgstr "Прошивка является дубликатом" msgid "Firmware is invalid" msgstr "Прошивка является неправильной" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "Прошивка слишком большая" @@ -1689,11 +1692,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1812,6 +1818,10 @@ msgstr "" "%d байт. Если этого нельзя избежать, передайте allow_inefficient=True в " "конструктор" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Пины должны быть последовательными" @@ -1858,6 +1868,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2002,7 +2016,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -2278,8 +2292,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2535,7 +2549,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -3793,7 +3807,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 85d9845b78..74cd6978c7 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -108,6 +108,7 @@ msgstr "%q innehåller dubblettstift" msgid "%q failure: %d" msgstr "%q-fel: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -190,7 +191,6 @@ msgstr "%q är utanför gränserna" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -403,6 +403,10 @@ msgstr "ADC2 används av WiFi" msgid "Address must be %d bytes long" msgstr "Adressen måste vara %d byte lång" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "All I2C-kringutrustning används" @@ -483,7 +487,7 @@ msgstr "Annonserar redan." msgid "Already have all-matches listener" msgstr "Har redan lyssnare för all-matchningar" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -507,7 +511,7 @@ msgstr "En annan send är redan aktiv" msgid "Array must contain halfwords (type 'H')" msgstr "Matrisen måste innehålla halfwords (typ \"H\")" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Matrisvärden ska bestå av enstaka bytes." @@ -931,10 +935,10 @@ msgstr "Fel i regex" msgid "Error: Failure to bind" msgstr "Fel: Bind misslyckades" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Förväntade %q" @@ -1037,7 +1041,6 @@ msgstr "Firmware är en dubblett" msgid "Firmware is invalid" msgstr "Firmware är ogiltig" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "Firmware är för stor" @@ -1657,11 +1660,14 @@ msgstr "" "Endast monokrom, indexerad 4 bpp eller 8 bpp och 16 bpp eller högre BMP: er " "stöds: %d bpp angiven" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "Endast en %q kan sättas i djup sömn." +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1782,6 +1788,10 @@ msgstr "" "%d byte. Om detta inte kan undvikas, skicka allow_inefficient=True till " "konstruktorn" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Pinnarna måste vara i sekvens" @@ -1828,6 +1838,10 @@ msgstr "Program gör OUT utan att läsa in OSR" msgid "Program size invalid" msgstr "Programstorlek ogiltig" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull används inte när riktningen är output." @@ -1972,7 +1986,7 @@ msgstr "Storleken stöds inte" msgid "Sleep Memory not available" msgstr "Sömnminne inte tillgängligt" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice och värde har olika längd." @@ -2256,9 +2270,9 @@ msgstr "Det går inte att läsa färgpalettdata" msgid "Unable to start mDNS query" msgstr "Det gick inte att starta mDNS-frågan" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" -msgstr "Kan inte skriva" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." +msgstr "" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2523,7 +2537,7 @@ msgid "array has too many dimensions" msgstr "array har för många dimensioner" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes krävs på höger sida" @@ -3791,7 +3805,7 @@ msgid "only sample_rate=16000 is supported" msgstr "enbart sample_rate=16000 stöds" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "endast segment med steg=1 (aka Ingen) stöds" @@ -4389,6 +4403,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 "Unable to write" +#~ msgstr "Kan inte skriva" + #~ msgid "%q length must be >= 1" #~ msgstr "längden på %q måste vara >= 1" diff --git a/locale/tr.po b/locale/tr.po index b5685d0878..bafd72bd7e 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -112,6 +112,7 @@ msgstr "%q yinelenen pinler içeriyor" msgid "%q failure: %d" msgstr "%q hata: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -192,7 +193,6 @@ msgstr "%q sınırların dışında" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -406,6 +406,10 @@ msgstr "ADC2, WiFi tarafından kullanılmaktadır" msgid "Address must be %d bytes long" msgstr "Adres %d byte uzunluğunda olmalıdır" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tüm CAN çevre birimleri kullanımda" @@ -486,7 +490,7 @@ msgstr "Halihazırda duyuruluyor." msgid "Already have all-matches listener" msgstr "Tüm eşleşmelerle eşleşen dinleyiciniz var" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -510,7 +514,7 @@ msgstr "Başka bir gönderme zaten aktif" msgid "Array must contain halfwords (type 'H')" msgstr "Dizi yarımsözcüklere sahip olmalıdır (tip 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "Dizi değerleri tekil bytelar olmalıdır." @@ -930,10 +934,10 @@ msgstr "regex'te hata" msgid "Error: Failure to bind" msgstr "Hata: Bağlanamadı" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "%q bekleniyor" @@ -1036,7 +1040,6 @@ msgstr "" msgid "Firmware is invalid" msgstr "Yazılım geçersiz" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "Yazılım çok büyük" @@ -1651,11 +1654,14 @@ msgid "" "%d bpp given" msgstr "" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "" +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1771,6 +1777,10 @@ msgid "" "constructor" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" @@ -1818,6 +1828,10 @@ msgstr "" msgid "Program size invalid" msgstr "" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1962,7 +1976,7 @@ msgstr "" msgid "Sleep Memory not available" msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -2236,8 +2250,8 @@ msgstr "" msgid "Unable to start mDNS query" msgstr "" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -2493,7 +2507,7 @@ msgid "array has too many dimensions" msgstr "" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -3751,7 +3765,7 @@ msgid "only sample_rate=16000 is supported" msgstr "" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 89f1c00379..b89f9cd9b5 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -111,6 +111,7 @@ msgstr "%q bāo hán chóng fù de yǐn jiǎo" msgid "%q failure: %d" msgstr "%q Shībài: %d" +#: ports/espressif/common-hal/espulp/ULP.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/microcontroller/Pin.c @@ -192,7 +193,6 @@ msgstr "%q chāo chū jiè xiàn" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c @@ -405,6 +405,10 @@ msgstr "ADC2 zhèngzài bèi WiFi shǐ yòng" msgid "Address must be %d bytes long" msgstr "dìzhǐ chángdù bìxū shì %d zìjié" +#: ports/espressif/common-hal/memorymap/AddressRange.c +msgid "Address range not allowed" +msgstr "" + #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "suǒyǒu CAN wàishè dōu zài shǐyòng zhōng" @@ -485,7 +489,7 @@ msgstr "Mùqián zhèngzài guǎngbō." msgid "Already have all-matches listener" msgstr "yǐjīng yǒu all-matches jiāntīng qì" -#: ports/espressif/common-hal/coproc/__init__.c +#: ports/espressif/common-hal/espulp/ULP.c #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -509,7 +513,7 @@ msgstr "Lìng yīgè fāsòng (send) yǐjīng zài gōngzuò" msgid "Array must contain halfwords (type 'H')" msgstr "Shùzǔ bìxū bāohán halfwords (type 'H')" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." msgstr "shùzǔ de zhí yīnggāi shì dān'gè zìjié." @@ -932,10 +936,10 @@ msgstr "Zhèngzé biǎodá shì cuòwù" msgid "Error: Failure to bind" msgstr "cuò wù: bǎng dìng shī bài" -#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/alarm/__init__.c shared-bindings/alarm/coproc/CoprocAlarm.c -#: shared-bindings/busio/SPI.c shared-bindings/coproc/Coproc.c -#: shared-bindings/coproc/__init__.c shared-bindings/microcontroller/Pin.c +#: ports/espressif/bindings/espulp/ULP.c py/enum.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Yù qí %q" @@ -1038,7 +1042,6 @@ msgstr "gù jiàn chóng fù" msgid "Firmware is invalid" msgstr "gù jiàn wú xiào" -#: ports/espressif/common-hal/coproc/Coproc.c #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware is too big" msgstr "gù jiàn tài dà" @@ -1663,11 +1666,14 @@ msgstr "" "Jǐn zhīchí dān sè, suǒyǐn wéi 4bpp huò 8bpp yǐjí 16bpp huò gèng gāo de BMP: " "Gěi chū %d bpp" -#: ports/espressif/common-hal/alarm/coproc/CoprocAlarm.c #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." msgstr "zài shēn dù shuì mián zhōng zhǐ néng shè zhì yí gè %q." +#: ports/espressif/common-hal/espulp/ULPAlarm.c +msgid "Only one %q can be set." +msgstr "" + #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" @@ -1786,6 +1792,10 @@ msgstr "" "duōzì jié. Rúguǒ wúfǎ bìmiǎn, qǐng jiāng allow_inefficient = True chuándì " "gěigòuzào hánshù" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Pins 21+ not supported from ULP" +msgstr "" + #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "yǐn jiǎo bì xū shì lián xù de" @@ -1832,6 +1842,10 @@ msgstr "chéng xù zài bù jiā zǎi Osr de qíng kuàng xià zhí xíng OUT" msgid "Program size invalid" msgstr "chéng xù dà xiǎo wú xiào" +#: ports/espressif/common-hal/espulp/ULP.c +msgid "Program too long" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." @@ -1976,7 +1990,7 @@ msgstr "bù zhī chí dà xiǎo" msgid "Sleep Memory not available" msgstr "shuì mián jì yì bù kě yòng" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Qiēpiàn hé zhí bùtóng chángdù." @@ -2261,9 +2275,9 @@ msgstr "Wúfǎ dúqǔ tiáosèbǎn shùjù" msgid "Unable to start mDNS query" msgstr "wú fǎ qǐ dòng mDNS chá xún" -#: shared-bindings/coproc/CoprocMemory.c -msgid "Unable to write" -msgstr "wú fǎ xiě rù" +#: shared-bindings/memorymap/AddressRange.c +msgid "Unable to write to address." +msgstr "" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2528,7 +2542,7 @@ msgid "array has too many dimensions" msgstr "shùzǔ yǒu tài duō wéidù" #: py/objarray.c shared-bindings/alarm/SleepMemory.c -#: shared-bindings/coproc/CoprocMemory.c shared-bindings/nvm/ByteArray.c +#: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "yòu cè xūyào shùzǔ/zì jié" @@ -3795,7 +3809,7 @@ msgid "only sample_rate=16000 is supported" msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c -#: shared-bindings/alarm/SleepMemory.c shared-bindings/coproc/CoprocMemory.c +#: shared-bindings/alarm/SleepMemory.c shared-bindings/memorymap/AddressRange.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" @@ -4395,6 +4409,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 "Unable to write" +#~ msgstr "wú fǎ xiě rù" + #~ msgid "%q length must be >= 1" #~ msgstr "%q cháng dù bìxū >= 1" From 8087887afd9f661a797eb50e6ed24b03a5e12dba Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 20 Dec 2022 22:18:43 -0500 Subject: [PATCH 310/357] Use returns_twice attribute to preserve regs in nlrthumb nlr_push() --- py/nlrthumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/nlrthumb.c b/py/nlrthumb.c index 30f9f2c196..4b20d30c6e 100644 --- a/py/nlrthumb.c +++ b/py/nlrthumb.c @@ -36,7 +36,7 @@ // For reference, arm/thumb callee save regs are: // r4-r11, r13=sp -__attribute__((naked)) unsigned int nlr_push(nlr_buf_t *nlr) { +__attribute__((naked, returns_twice)) unsigned int nlr_push(nlr_buf_t *nlr) { __asm volatile ( "str r4, [r0, #12] \n" // store r4 into nlr_buf From f97925c66c20972c68e6eb96219342974eb2b62d Mon Sep 17 00:00:00 2001 From: Bernhard Bablok Date: Wed, 21 Dec 2022 13:27:23 +0100 Subject: [PATCH 311/357] ignore .devcontainer/* --- tools/ci_set_matrix.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index 3ec3ba9b73..79ec5c7ace 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -58,6 +58,8 @@ IGNORE = [ "tools/ci_check_duplicate_usb_vid_pid.py", ] +IGNORE_DIRS = ["tests", "docs", ".devcontainer"] + if len(sys.argv) > 1: print("Using files list on commandline") changed_files = sys.argv[1:] @@ -150,7 +152,7 @@ def set_boards_to_build(build_all): continue # Boards don't run tests or docs so ignore those as well. - if p.startswith("tests") or p.startswith("docs"): + if any([p.startswith(d) for d in IGNORE_DIRS]): continue # As a (nearly) last resort, for some certain files, we compute the settings from the From 868a98323a4bcefb5acb47da0ba82c07edf8f486 Mon Sep 17 00:00:00 2001 From: Bernhard Bablok Date: Wed, 21 Dec 2022 15:18:33 +0100 Subject: [PATCH 312/357] added comment for IGNORE_DIRS --- tools/ci_set_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index 79ec5c7ace..77f58742cd 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -58,6 +58,7 @@ IGNORE = [ "tools/ci_check_duplicate_usb_vid_pid.py", ] +# Files in these directories never influence board builds IGNORE_DIRS = ["tests", "docs", ".devcontainer"] if len(sys.argv) > 1: @@ -151,7 +152,6 @@ def set_boards_to_build(build_all): if p in IGNORE: continue - # Boards don't run tests or docs so ignore those as well. if any([p.startswith(d) for d in IGNORE_DIRS]): continue From e80ff2058373533c565b6962287e8511f2d498f2 Mon Sep 17 00:00:00 2001 From: evildave666 Date: Thu, 22 Dec 2022 09:29:24 +0900 Subject: [PATCH 313/357] Remove IO11 from definition It is used internally on this particular board version despite being broken out to a pin and marked on silkscreen. --- ports/espressif/boards/luatos_core_esp32c3/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/luatos_core_esp32c3/pins.c b/ports/espressif/boards/luatos_core_esp32c3/pins.c index b472446fe2..f45205b5c3 100644 --- a/ports/espressif/boards/luatos_core_esp32c3/pins.c +++ b/ports/espressif/boards/luatos_core_esp32c3/pins.c @@ -24,7 +24,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, - { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + // IO11 used internally on this board version despite being broken out to a pin { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, From 7cfdd24f771e9e018a5f63364c5d4c08694a3384 Mon Sep 17 00:00:00 2001 From: evildave666 Date: Thu, 22 Dec 2022 09:30:52 +0900 Subject: [PATCH 314/357] Change flash mode to dio --- ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk b/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk index 29f1719153..e0df58f756 100644 --- a/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk +++ b/ports/espressif/boards/luatos_core_esp32c3/mpconfigboard.mk @@ -3,6 +3,6 @@ CIRCUITPY_CREATION_ID = 0x00C30001 IDF_TARGET = esp32c3 -CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=80m CIRCUITPY_ESP_FLASH_SIZE=4MB From 26143e057fcd6b74187baf682d7b5740ef1918bd Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 21 Dec 2022 15:15:39 +0000 Subject: [PATCH 315/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (995 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 4a95e608d4..39b93d335f 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-12-16 21:50+0000\n" +"PO-Revision-Date: 2022-12-22 15:49+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.15\n" +"X-Generator: Weblate 4.15.1-dev\n" #: main.c msgid "" @@ -408,7 +408,7 @@ msgstr "O endereço deve ter %d bytes de comprimento" #: ports/espressif/common-hal/memorymap/AddressRange.c msgid "Address range not allowed" -msgstr "" +msgstr "Intervalo de endereços não permitido" #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" @@ -1683,7 +1683,7 @@ msgstr "Apenas um %q pode ser colocado em hibernação profunda." #: ports/espressif/common-hal/espulp/ULPAlarm.c msgid "Only one %q can be set." -msgstr "" +msgstr "Apenas um %q pode ser definido." #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c @@ -1807,7 +1807,7 @@ msgstr "" #: ports/espressif/common-hal/espulp/ULP.c msgid "Pins 21+ not supported from ULP" -msgstr "" +msgstr "Os pinos 21+ não são suportados pelo ULP" #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" @@ -1860,7 +1860,7 @@ msgstr "O tamanho do programa é inválido" #: ports/espressif/common-hal/espulp/ULP.c msgid "Program too long" -msgstr "" +msgstr "Programa muito longo" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -2296,7 +2296,7 @@ msgstr "Não é possível iniciar a consulta mDNS" #: shared-bindings/memorymap/AddressRange.c msgid "Unable to write to address." -msgstr "" +msgstr "Não é possível gravar no endereço." #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." From 9bf62d1433d7bf008c5306f80da68c6610942d8d Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 21 Dec 2022 14:44:03 +0000 Subject: [PATCH 316/357] Translated using Weblate (Swedish) Currently translated at 100.0% (995 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 74cd6978c7..1ad79178d7 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-12-15 12:49+0000\n" +"PO-Revision-Date: 2022-12-22 15:49+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.15-dev\n" +"X-Generator: Weblate 4.15.1-dev\n" #: main.c msgid "" @@ -405,7 +405,7 @@ msgstr "Adressen måste vara %d byte lång" #: ports/espressif/common-hal/memorymap/AddressRange.c msgid "Address range not allowed" -msgstr "" +msgstr "Adressintervallet är inte tillåtet" #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" @@ -1666,7 +1666,7 @@ msgstr "Endast en %q kan sättas i djup sömn." #: ports/espressif/common-hal/espulp/ULPAlarm.c msgid "Only one %q can be set." -msgstr "" +msgstr "Endast en %q kan ställas in." #: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c @@ -1790,7 +1790,7 @@ msgstr "" #: ports/espressif/common-hal/espulp/ULP.c msgid "Pins 21+ not supported from ULP" -msgstr "" +msgstr "Pins 21+ stöds inte av ULP" #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" @@ -1840,7 +1840,7 @@ msgstr "Programstorlek ogiltig" #: ports/espressif/common-hal/espulp/ULP.c msgid "Program too long" -msgstr "" +msgstr "Programmet är för långt" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -2272,7 +2272,7 @@ msgstr "Det gick inte att starta mDNS-frågan" #: shared-bindings/memorymap/AddressRange.c msgid "Unable to write to address." -msgstr "" +msgstr "Det går inte att skriva till adress." #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." From 94dbefacf1e6b01c7458804323f707f067a8185a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 23 Dec 2022 19:17:45 -0600 Subject: [PATCH 317/357] Issue 7352 - set max value of a pulsein --- ports/espressif/common-hal/pulseio/PulseIn.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ports/espressif/common-hal/pulseio/PulseIn.c b/ports/espressif/common-hal/pulseio/PulseIn.c index 41c1dcb189..bb6ef7f975 100644 --- a/ports/espressif/common-hal/pulseio/PulseIn.c +++ b/ports/espressif/common-hal/pulseio/PulseIn.c @@ -41,7 +41,12 @@ STATIC void update_internal_buffer(pulseio_pulsein_obj_t *self) { length /= 4; for (size_t i = 0; i < length; i++) { uint16_t pos = (self->start + self->len) % self->maxlen; - self->buffer[pos] = items[i].duration0 * 3; + uint32_t val = items[i].duration0 * 3; + // make sure the value returned does not exceed the max uint16 value. + if (val > 65535) { + val = 65535; + } + self->buffer[pos] = (uint16_t)val; if (self->len < self->maxlen) { self->len++; } else { @@ -50,7 +55,11 @@ STATIC void update_internal_buffer(pulseio_pulsein_obj_t *self) { // Check if second item exists if (items[i].duration1) { pos = (self->start + self->len) % self->maxlen; - self->buffer[pos] = items[i].duration1 * 3; + val = items[i].duration1 * 3; + if (val > 65535) { + val = 65535; + } + self->buffer[pos] = (uint16_t)val; if (self->len < self->maxlen) { self->len++; } else { From cdefd2e674771174172aa004329989002b406937 Mon Sep 17 00:00:00 2001 From: Jay Greco Date: Thu, 22 Dec 2022 06:57:25 +0000 Subject: [PATCH 318/357] Add nullbits Bit-C PRO board --- .../boards/nullbits_bit_c_pro/board.c | 29 +++++++++++ .../boards/nullbits_bit_c_pro/mpconfigboard.h | 17 +++++++ .../nullbits_bit_c_pro/mpconfigboard.mk | 9 ++++ .../nullbits_bit_c_pro/pico-sdk-configboard.h | 4 ++ .../boards/nullbits_bit_c_pro/pins.c | 49 +++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 ports/raspberrypi/boards/nullbits_bit_c_pro/board.c create mode 100644 ports/raspberrypi/boards/nullbits_bit_c_pro/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/nullbits_bit_c_pro/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/nullbits_bit_c_pro/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/nullbits_bit_c_pro/pins.c diff --git a/ports/raspberrypi/boards/nullbits_bit_c_pro/board.c b/ports/raspberrypi/boards/nullbits_bit_c_pro/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/nullbits_bit_c_pro/board.c @@ -0,0 +1,29 @@ +/* + * 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/nullbits_bit_c_pro/mpconfigboard.h b/ports/raspberrypi/boards/nullbits_bit_c_pro/mpconfigboard.h new file mode 100644 index 0000000000..d2a514006a --- /dev/null +++ b/ports/raspberrypi/boards/nullbits_bit_c_pro/mpconfigboard.h @@ -0,0 +1,17 @@ +#define MICROPY_HW_BOARD_NAME "nullbits Bit-C PRO" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) + +#define CIRCUITPY_RGB_STATUS_INVERTED_PWM +#define CIRCUITPY_RGB_STATUS_R (&pin_GPIO16) +#define CIRCUITPY_RGB_STATUS_G (&pin_GPIO17) +#define CIRCUITPY_RGB_STATUS_B (&pin_GPIO18) diff --git a/ports/raspberrypi/boards/nullbits_bit_c_pro/mpconfigboard.mk b/ports/raspberrypi/boards/nullbits_bit_c_pro/mpconfigboard.mk new file mode 100644 index 0000000000..81271d3721 --- /dev/null +++ b/ports/raspberrypi/boards/nullbits_bit_c_pro/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x2E8A +USB_PID = 0x1048 +USB_PRODUCT = "Bit-C PRO" +USB_MANUFACTURER = "nullbits" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "GD25Q32C" diff --git a/ports/raspberrypi/boards/nullbits_bit_c_pro/pico-sdk-configboard.h b/ports/raspberrypi/boards/nullbits_bit_c_pro/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/nullbits_bit_c_pro/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/nullbits_bit_c_pro/pins.c b/ports/raspberrypi/boards/nullbits_bit_c_pro/pins.c new file mode 100644 index 0000000000..ac1b1a8065 --- /dev/null +++ b/ports/raspberrypi/boards/nullbits_bit_c_pro/pins.c @@ -0,0 +1,49 @@ +#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_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO29) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_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); From 2901399cc61f77f144b6b871694cc8a1e1677476 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 19 Dec 2022 09:04:09 -0600 Subject: [PATCH 319/357] No need to depend it here, conf.py runs `make stubs` --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b35b5c66b9..40952d261d 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ clean: rm -rf autoapi rm -rf $(STUBDIR) $(DISTDIR) *.egg-info -html: stubs +html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." From 4dbbfa0931670b8fe0a585a9b8276934b6cfd861 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Dec 2022 10:45:42 -0600 Subject: [PATCH 320/357] Print errors to repl about getenv --- locale/circuitpython.pot | 14 ++++-- shared-module/os/__init__.h | 2 + shared-module/os/getenv.c | 96 +++++++++++++++++++++++++------------ 3 files changed, 78 insertions(+), 34 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0cf1027239..28963bd4a8 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -65,6 +65,11 @@ msgstr "" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -488,6 +493,11 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1754,10 +1764,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/shared-module/os/__init__.h b/shared-module/os/__init__.h index 0e1d78c53b..1b18a1f4b9 100644 --- a/shared-module/os/__init__.h +++ b/shared-module/os/__init__.h @@ -38,9 +38,11 @@ typedef enum { // Allocation free version that returns the full length of the value. // If it fits, the return value is 0-terminated. The passed in buffer // may be modified even if an error is returned. Allocation free. +// An error that is not 'open' or 'not found' is printed on the repl. os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len); // Returns GETENV_OK and sets value to the read value. Returns // GETENV_ERR_... if the value was not numeric. allocation-free. // If any error code is returned, value is guaranteed not modified +// An error that is not 'open' or 'not found' is printed on the repl. os_getenv_err_t common_hal_os_getenv_int(const char *key, mp_int_t *value); diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index d96b1fb306..d9e75484ec 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -28,6 +28,7 @@ // tested in the unix "coverage" build, without bringing in "our" os module #include +#include #include #include "shared-bindings/os/__init__.h" @@ -36,6 +37,7 @@ #include "py/gc.h" #include "py/misc.h" #include "py/mpstate.h" +#include "py/mpprint.h" #include "py/objstr.h" #include "py/parsenum.h" #include "py/runtime.h" @@ -311,7 +313,58 @@ STATIC os_getenv_err_t os_getenv_buf_terminated(const char *key, char *value, si return result; } -os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len) { +STATIC void print_dont_raise(const mp_obj_type_t *exc_type, const compressed_string_t *fmt, ...) { + va_list argptr; + va_start(argptr,fmt); + mp_vcprintf(&mp_plat_print, fmt, argptr); + mp_printf(&mp_plat_print, "\n"); + va_end(argptr); +} + +STATIC void handle_getenv_error(os_getenv_err_t error, void (*handle)(const mp_obj_type_t *exc_type, const compressed_string_t *fmt, ...)) { + if (error == GETENV_OK) { + return; + } + if (error & GETENV_ERR_UNEXPECTED) { + byte character = (error & 0xff); + char buf[8]; + vstr_t vstr; + vstr_init_fixed_buf(&vstr, sizeof(buf), buf); + mp_print_t print = { .data = &vstr, .print_strn = (mp_print_strn_t)vstr_add_strn }; + + if (character) { + mp_str_print_quoted(&print, &character, 1, true); + } else { + mp_str_print_quoted(&print, (byte *)"EOF", 3, true); + } + handle(&mp_type_ValueError, translate("Invalid byte %.*s"), vstr.len, vstr.buf); + } else { + switch (error) { + case GETENV_ERR_OPEN: + handle(&mp_type_ValueError, translate("%S"), translate("File not found")); + break; + case GETENV_ERR_UNICODE: + handle(&mp_type_ValueError, translate("%S"), translate("Invalid unicode escape")); + break; + case GETENV_ERR_NOT_FOUND: + handle(&mp_type_ValueError, translate("%S"), translate("Key not found")); + break; + default: + handle(&mp_type_RuntimeError, translate("%S"), translate("Internal error")); + break; + } + } +} + +STATIC void common_hal_os_getenv_showerr(const char *key, os_getenv_err_t result) { + if (result != GETENV_OK && result != GETENV_ERR_OPEN && result != GETENV_ERR_NOT_FOUND) { + mp_cprintf(&mp_plat_print, translate("An error occurred while retrieving '%s':\n"), key); + handle_getenv_error(result, print_dont_raise); + } +} + +STATIC +os_getenv_err_t common_hal_os_getenv_str_inner(const char *key, char *value, size_t value_len) { bool quoted; os_getenv_err_t result = os_getenv_buf_terminated(key, value, value_len, "ed); if (result == GETENV_OK && !quoted) { @@ -320,33 +373,10 @@ os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t va return result; } -STATIC void throw_getenv_error(os_getenv_err_t error) { - if (error == GETENV_OK) { - return; - } - if (error & GETENV_ERR_UNEXPECTED) { - byte character = (error & 0xff); - mp_print_t print; - vstr_t vstr; - vstr_init_print(&vstr, 8 + 4 + 1, &print); - if (character) { - mp_str_print_quoted(&print, &character, 1, true); - } else { - mp_str_print_quoted(&print, (byte *)"EOF", 3, true); - } - mp_raise_ValueError_varg(translate("Invalid byte %.*s"), - vstr.len, vstr.buf); - } - switch (error) { - case GETENV_ERR_OPEN: - mp_raise_ValueError(translate("File not found")); - case GETENV_ERR_UNICODE: - mp_raise_ValueError(translate("Invalid unicode escape")); - case GETENV_ERR_NOT_FOUND: - mp_raise_ValueError(translate("Key not found")); - default: - mp_raise_RuntimeError(translate("Internal error")); - } +os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len) { + os_getenv_err_t result = common_hal_os_getenv_str_inner(key, value, value_len); + common_hal_os_getenv_showerr(key, result); + return result; } mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t default_) { @@ -358,7 +388,7 @@ mp_obj_t common_hal_os_getenv_path(const char *path, const char *key, mp_obj_t d if (result == GETENV_ERR_NOT_FOUND || result == GETENV_ERR_OPEN) { return default_; } - throw_getenv_error(result); + handle_getenv_error(result, mp_raise_msg_varg); if (quoted) { return mp_obj_new_str_from_vstr(&mp_type_str, &buf); @@ -371,7 +401,7 @@ mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_) { return common_hal_os_getenv_path(GETENV_PATH, key, default_); } -os_getenv_err_t common_hal_os_getenv_int(const char *key, mp_int_t *value) { +STATIC os_getenv_err_t common_hal_os_getenv_int_inner(const char *key, mp_int_t *value) { char buf[16]; bool quoted; os_getenv_err_t result = os_getenv_buf_terminated(key, buf, sizeof(buf), "ed); @@ -389,3 +419,9 @@ os_getenv_err_t common_hal_os_getenv_int(const char *key, mp_int_t *value) { *value = (mp_int_t)num; return GETENV_OK; } + +os_getenv_err_t common_hal_os_getenv_int(const char *key, mp_int_t *value) { + os_getenv_err_t result = common_hal_os_getenv_int_inner(key, value); + common_hal_os_getenv_showerr(key, result); + return result; +} From f6b69cf5e3aca4ab745e666f5485a4a5f628fe77 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Dec 2022 10:49:57 -0600 Subject: [PATCH 321/357] Allow settings.toml to end without a newline --- shared-module/os/getenv.c | 2 +- tests/circuitpython/getenv.py | 3 +++ tests/circuitpython/getenv.py.exp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index d9e75484ec..21a97f3fec 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -201,6 +201,7 @@ STATIC os_getenv_err_t read_string_value(file_arg *active_file, vstr_t *buf) { case '#': next_line(active_file); MP_FALLTHROUGH; + case 0: case '\n': return GETENV_OK; default: @@ -257,7 +258,6 @@ STATIC os_getenv_err_t read_bare_value(file_arg *active_file, vstr_t *buf, int f while (true) { switch (character) { case 0: - return GETENV_ERR_UNEXPECTED | character; case '\n': return GETENV_OK; case '#': diff --git a/tests/circuitpython/getenv.py b/tests/circuitpython/getenv.py index ad8fdbfeeb..b63f587730 100644 --- a/tests/circuitpython/getenv.py +++ b/tests/circuitpython/getenv.py @@ -75,5 +75,8 @@ def run_test(key, content): for i in range(13): run_test(f"key{i}", content_good) +# Test value without trailing newline +run_test(f"noeol", "noeol=3") + for content in content_bad: run_test("key", content) diff --git a/tests/circuitpython/getenv.py.exp b/tests/circuitpython/getenv.py.exp index f83143c80b..0dcc8f78d3 100644 --- a/tests/circuitpython/getenv.py.exp +++ b/tests/circuitpython/getenv.py.exp @@ -11,6 +11,7 @@ key9 'hello comment' key10 127 key11 0 key12 None +noeol 3 key Invalid byte '\n' key Invalid byte '"' key invalid syntax for integer with base 10: '' From 337b1da143547b2d8266260cb2824c701106ddf0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Dec 2022 10:53:36 -0600 Subject: [PATCH 322/357] Explicitly test \n and \r\n files \r\n files must be working due to micropython's built in handling of text-mode files, I didn't implement it. \r-only (old mac text-mode files) are explicitly not supported by the toml format. --- tests/circuitpython/getenv.py | 18 +++++++++++------- tests/circuitpython/getenv.py.exp | 13 +++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/tests/circuitpython/getenv.py b/tests/circuitpython/getenv.py index b63f587730..2dccb99f97 100644 --- a/tests/circuitpython/getenv.py +++ b/tests/circuitpython/getenv.py @@ -35,7 +35,7 @@ bdev = RAMBlockDevice(64) uos.VfsFat.mkfs(bdev) uos.mount(uos.VfsFat(bdev), "/") -content_good = """ +content_good = b""" # comment key0 = "hello world" key1 = 7 @@ -54,15 +54,15 @@ subvalue = "hi" """ content_bad = [ - 'key = "\n', - 'key = """\n', - "key =\n", - 'key="', + b'key = "\n', + b'key = """\n', + b"key =\n", + b'key="', ] def run_test(key, content): - with open("/settings.toml", "w") as f: + with open("/settings.toml", "wb") as f: f.write(content) try: @@ -72,11 +72,15 @@ def run_test(key, content): print(key, str(e)) +for i in range(13): + run_test(f"key{i}", content_good) + +content_good = content_good.replace(b"\n", b"\r\n") for i in range(13): run_test(f"key{i}", content_good) # Test value without trailing newline -run_test(f"noeol", "noeol=3") +run_test(f"noeol", b"noeol=3") for content in content_bad: run_test("key", content) diff --git a/tests/circuitpython/getenv.py.exp b/tests/circuitpython/getenv.py.exp index 0dcc8f78d3..91c96e601a 100644 --- a/tests/circuitpython/getenv.py.exp +++ b/tests/circuitpython/getenv.py.exp @@ -11,6 +11,19 @@ key9 'hello comment' key10 127 key11 0 key12 None +key0 'hello world' +key1 7 +key2 Invalid byte '\n' +key3 'Áx' +key4 'Áx' +key5 Invalid byte '\\' +key6 '\t\r\x08' +key7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +key8 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +key9 'hello comment' +key10 127 +key11 0 +key12 None noeol 3 key Invalid byte '\n' key Invalid byte '"' From 928fb0a9c4ec8a3f1903f3f7aefcf63f252cea62 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Dec 2022 13:57:15 -0600 Subject: [PATCH 323/357] Make the "name or service not known" message translatable --- locale/circuitpython.pot | 4 ++++ ports/espressif/common-hal/socketpool/Socket.c | 4 ++-- .../common-hal/socketpool/SocketPool.c | 2 +- shared-bindings/socketpool/SocketPool.c | 17 +++++++++++------ shared-bindings/socketpool/SocketPool.h | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0cf1027239..17c39cafdc 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1393,6 +1393,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "" diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index 18237a4d4e..ccb01116d8 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -369,7 +369,7 @@ void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *self, struct addrinfo *result_i; int error = lwip_getaddrinfo(host, NULL, &hints, &result_i); if (error != 0 || result_i == NULL) { - common_hal_socketpool_socketpool_raise_gaierror(SOCKETPOOL_EAI_NONAME, MP_QSTR_Name_space_or_space_service_space_not_space_known); + common_hal_socketpool_socketpool_raise_gaierror_noname(); } // Set parameters @@ -550,7 +550,7 @@ mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t *self, struct addrinfo *result_i; int error = lwip_getaddrinfo(host, NULL, &hints, &result_i); if (error != 0 || result_i == NULL) { - common_hal_socketpool_socketpool_raise_gaierror(SOCKETPOOL_EAI_NONAME, MP_QSTR_Name_space_or_space_service_space_not_space_known); + common_hal_socketpool_socketpool_raise_gaierror_noname(); } // Set parameters diff --git a/ports/raspberrypi/common-hal/socketpool/SocketPool.c b/ports/raspberrypi/common-hal/socketpool/SocketPool.c index bdbc7f67c5..e562314d69 100644 --- a/ports/raspberrypi/common-hal/socketpool/SocketPool.c +++ b/ports/raspberrypi/common-hal/socketpool/SocketPool.c @@ -98,7 +98,7 @@ void socketpool_resolve_host_raise(socketpool_socketpool_obj_t *self, const char int result = socketpool_resolve_host(self, host, addr); if (result < 0) { printf("socket_resolve_host() returned %d\n", result); - common_hal_socketpool_socketpool_raise_gaierror(SOCKETPOOL_EAI_NONAME, MP_QSTR_Name_space_or_space_service_space_not_space_known); + common_hal_socketpool_socketpool_raise_gaierror_noname(); mp_raise_OSError(-result); } } diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 660aba63ed..f056c741f3 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -198,16 +198,21 @@ MP_WEAK mp_obj_t common_hal_socketpool_socketpool_gethostbyname_raise(socketpool_socketpool_obj_t *self, const char *host) { mp_obj_t ip_str = common_hal_socketpool_socketpool_gethostbyname(self, host); if (ip_str == mp_const_none) { - common_hal_socketpool_socketpool_raise_gaierror(SOCKETPOOL_EAI_NONAME, MP_QSTR_Name_space_or_space_service_space_not_space_known); + common_hal_socketpool_socketpool_raise_gaierror_noname(); } return ip_str; } MP_WEAK NORETURN -void common_hal_socketpool_socketpool_raise_gaierror(int value, qstr name) { - mp_obj_t exc_args[2] = { - MP_OBJ_NEW_SMALL_INT(value), - MP_OBJ_NEW_QSTR(name), +void common_hal_socketpool_socketpool_raise_gaierror_noname(void) { + vstr_t vstr; + mp_print_t print; + vstr_init_print(&vstr, 64, &print); + mp_printf(&print, "%S", translate("Name or service not known")); + + mp_obj_t exc_args[] = { + MP_OBJ_NEW_SMALL_INT(SOCKETPOOL_EAI_NONAME), + mp_obj_new_str_from_vstr(&mp_type_str, &vstr), }; - nlr_raise(mp_obj_new_exception_args(&mp_type_gaierror, 2, exc_args)); + nlr_raise(mp_obj_new_exception_args(&mp_type_gaierror, MP_ARRAY_SIZE(exc_args), exc_args)); } diff --git a/shared-bindings/socketpool/SocketPool.h b/shared-bindings/socketpool/SocketPool.h index cecbdd86f1..6409f8c763 100644 --- a/shared-bindings/socketpool/SocketPool.h +++ b/shared-bindings/socketpool/SocketPool.h @@ -73,6 +73,6 @@ bool socketpool_socket(socketpool_socketpool_obj_t *self, socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type, socketpool_socket_obj_t *sock); -NORETURN void common_hal_socketpool_socketpool_raise_gaierror(int value, qstr name); +NORETURN void common_hal_socketpool_socketpool_raise_gaierror_noname(void); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKETPOOL_H From fc67e8794222380446743b63a341bb1d0006b0d1 Mon Sep 17 00:00:00 2001 From: Clay Date: Tue, 27 Dec 2022 07:13:15 +0000 Subject: [PATCH 324/357] Translated using Weblate (Russian) Currently translated at 35.6% (355 of 995 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ru/ --- locale/ru.po | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/locale/ru.po b/locale/ru.po index ef8dc019b4..08470eda78 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -7,16 +7,16 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-11-29 01:02+0000\n" +"PO-Revision-Date: 2022-12-27 17:42+0000\n" "Last-Translator: Clay \n" "Language-Team: none\n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.15-dev\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.15.1-dev\n" #: main.c msgid "" @@ -168,7 +168,7 @@ msgstr "%q должно быть >= %d" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q должно быть bytearray или array типа ‘H' или 'B'" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" @@ -205,7 +205,7 @@ msgstr "Пин %q не допустим" #: py/objrange.c py/objslice.c shared-bindings/random/__init__.c msgid "%q step cannot be zero" -msgstr "" +msgstr "Шаг %q не может быть нулём" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -406,7 +406,7 @@ msgstr "Адрес должен быть длиной %d байт" #: ports/espressif/common-hal/memorymap/AddressRange.c msgid "Address range not allowed" -msgstr "" +msgstr "Диапазон адресов не разрешен" #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" @@ -917,8 +917,10 @@ msgid "Drive mode not used when direction is input." msgstr "Drive mode не используется, когда направление является входным." #: py/obj.c +#, fuzzy msgid "During handling of the above exception, another exception occurred:" msgstr "" +"Во время обработки вышеупомянутого исключения произошло другое исключение:" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" @@ -1040,7 +1042,7 @@ msgstr "Файл существует" #: shared-module/os/getenv.c msgid "File not found" -msgstr "" +msgstr "Файл не найден" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c @@ -1291,7 +1293,7 @@ msgstr "Недопустимое бит-на-значение" #: shared-module/os/getenv.c #, c-format msgid "Invalid byte %.*s" -msgstr "" +msgstr "Неверный байт %.*s" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format @@ -1333,7 +1335,7 @@ msgstr "Ключ должен быть длинной 16, 24 или 32 байт #: shared-module/os/getenv.c msgid "Key not found" -msgstr "" +msgstr "Ключ не найден" #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" @@ -1377,7 +1379,7 @@ msgstr "Размер данных различается" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Mismatched swap flag" -msgstr "" +msgstr "Несоответствие флага swap" #: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" @@ -1694,7 +1696,7 @@ msgstr "" #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one %q can be set in deep sleep." -msgstr "" +msgstr "Только один %q может быть погружен в глубокий сон." #: ports/espressif/common-hal/espulp/ULPAlarm.c msgid "Only one %q can be set." @@ -4378,7 +4380,7 @@ msgstr "" #: extmod/ulab/code/numpy/vector.c msgid "wrong output type" -msgstr "" +msgstr "неверный тип вывода" #: shared-module/displayio/Shape.c msgid "x value out of bounds" @@ -4386,7 +4388,7 @@ msgstr "" #: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" -msgstr "" +msgstr "xTaskCreate провалился" #: shared-module/displayio/Shape.c msgid "y value out of bounds" @@ -4394,7 +4396,7 @@ msgstr "" #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi должен быть bytearray" #: extmod/ulab/code/scipy/signal/signal.c msgid "zi must be of float type" From 7925069a773f0a4c7c52f0e01e384739db54608b Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 27 Dec 2022 18:42:37 +0100 Subject: [PATCH 325/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 14 ++++++++++---- locale/cs.po | 14 ++++++++++---- locale/de_DE.po | 14 ++++++++++---- locale/el.po | 14 ++++++++++---- locale/en_GB.po | 14 ++++++++++---- locale/es.po | 14 ++++++++++---- locale/fil.po | 14 ++++++++++---- locale/fr.po | 14 ++++++++++---- locale/hi.po | 14 ++++++++++---- locale/it_IT.po | 14 ++++++++++---- locale/ja.po | 14 ++++++++++---- locale/ko.po | 14 ++++++++++---- locale/nl.po | 14 ++++++++++---- locale/pl.po | 14 ++++++++++---- locale/pt_BR.po | 17 +++++++++++++---- locale/ru.po | 18 ++++++++++++------ locale/sv.po | 17 +++++++++++++---- locale/tr.po | 14 ++++++++++---- locale/zh_Latn_pinyin.po | 14 ++++++++++---- 19 files changed, 198 insertions(+), 78 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 3aaca9e203..ab5ea27d40 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -70,6 +70,11 @@ msgstr "%%c harus int atau char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -494,6 +499,11 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1779,10 +1789,6 @@ msgstr "" "ideal. Jika ini tidak dapat dihindari, berikan allow_inefficient=True ke " "konstruktor" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Pin harus berurutan" diff --git a/locale/cs.po b/locale/cs.po index 5010b8b862..ce0b944057 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -72,6 +72,11 @@ msgstr "%%c vyžaduje int nebo char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -495,6 +500,11 @@ msgstr "Již běží" msgid "Already scanning for wifi networks" msgstr "Již skenuje wifi sítě" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Jiný PWMAudioOut je již aktivní" @@ -1770,10 +1780,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 3f1d800592..1c751f839e 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -71,6 +71,11 @@ msgstr "%%c erwartet Int oder Char" msgid "%02X" msgstr "%02X" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -498,6 +503,11 @@ msgstr "Läuft bereits" msgid "Already scanning for wifi networks" msgstr "Sucht bereits nach Wifi-Netzwerken" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Ein anderer PWMAudioOut ist bereits aktiv" @@ -1794,10 +1804,6 @@ msgstr "" "Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergib " "allow_inefficient=True an den Konstruktor" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Pins müssen geordnet sein" diff --git a/locale/el.po b/locale/el.po index e022e3a90e..bc2d642ed9 100644 --- a/locale/el.po +++ b/locale/el.po @@ -76,6 +76,11 @@ msgstr "%%c απαιτεί int ή char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -501,6 +506,11 @@ msgstr "Τρέχει ήδη" msgid "Already scanning for wifi networks" msgstr "Ήδη γίνεται σάρωση για δίκτυα wifi" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Και άλλο PWMAudioOut είναι σε χρήση" @@ -1779,10 +1789,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 0f166288bf..34d1dd5f2a 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -74,6 +74,11 @@ msgstr "%%c requires int or char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -498,6 +503,11 @@ msgstr "Already running" msgid "Already scanning for wifi networks" msgstr "Already scanning for WiFi networks" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Another PWMAudioOut is already active" @@ -1778,10 +1788,6 @@ msgstr "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Pins must be sequential" diff --git a/locale/es.po b/locale/es.po index dd420bbd2e..558fc6ddf0 100644 --- a/locale/es.po +++ b/locale/es.po @@ -74,6 +74,11 @@ msgstr "%%c requiere int o char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -502,6 +507,11 @@ msgstr "Ya está en ejecución" msgid "Already scanning for wifi networks" msgstr "Ya se están buscando redes wifi" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Otra salida PWMAudioOut esta ya activada" @@ -1803,10 +1813,6 @@ msgstr "" "ideales. Si esto no se puede evitar, pase allow_inefficient=True al " "constructor" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Los pines deben estar en orden secuencial" diff --git a/locale/fil.po b/locale/fil.po index 7844d12562..51468a0a5b 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -66,6 +66,11 @@ msgstr "%%c nangangailangan ng int o char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -491,6 +496,11 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1770,10 +1780,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 0f0afce8ff..fa071b4f47 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -75,6 +75,11 @@ msgstr "%%c nécessite un chiffre entier 'int' ou un caractère 'char'" msgid "%02X" msgstr "%02X" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -500,6 +505,11 @@ msgstr "Déjà en cours d'exécution" msgid "Already scanning for wifi networks" msgstr "Déjà à la recherche des réseaux wifi" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Un autre PWMAudioOut est déjà actif" @@ -1823,10 +1833,6 @@ msgstr "" "octets idéal. Si cela ne peut pas être évité, transmettez allow_inefficient " "= True au constructeur" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Les broches doivent être séquentielles" diff --git a/locale/hi.po b/locale/hi.po index 7243d82e75..bc22a63370 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -65,6 +65,11 @@ msgstr "" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -488,6 +493,11 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1754,10 +1764,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 401a9b9848..51d4cf1088 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -71,6 +71,11 @@ msgstr "%%c necessita di int o char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -497,6 +502,11 @@ msgstr "Già in funzione" msgid "Already scanning for wifi networks" msgstr "Già in ricerca di collegamenti WiFi" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1779,10 +1789,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 0c099d26c3..49e00a558d 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -70,6 +70,11 @@ msgstr "%%c にはintまたはcharが必要" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -493,6 +498,11 @@ msgstr "すでに実行中" msgid "Already scanning for wifi networks" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1767,10 +1777,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 83832d31ef..c0629fa452 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -66,6 +66,11 @@ msgstr "%%c 전수(int)또는 캐릭터(char)필요합니다" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -489,6 +494,11 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1757,10 +1767,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index f639bcec2a..f7d3237aad 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -68,6 +68,11 @@ msgstr "%%c vereist een int of char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -491,6 +496,11 @@ msgstr "Wordt al uitgevoerd" msgid "Already scanning for wifi networks" msgstr "Zoekt al naar WiFi netwerken" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1776,10 +1786,6 @@ msgstr "" "gebruikt. Als dit niet kan worden vermeden, geef dan het argument " "allow_inefficient=True aan de constructor" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 39853c1ddf..9e496f8d26 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -70,6 +70,11 @@ msgstr "%%c wymaga int lub char" msgid "%02X" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -493,6 +498,11 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -1765,10 +1775,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 39b93d335f..933a066371 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -72,6 +72,11 @@ msgstr "%%c requer int ou char" msgid "%02X" msgstr "%02X" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -501,6 +506,11 @@ msgstr "Já está em execução" msgid "Already scanning for wifi networks" msgstr "Já está em busca das redes de wifi" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Um outro PWMAudioOut já está ativo" @@ -1805,10 +1815,6 @@ msgstr "" "ideal. Caso isso não possa ser evitado, passe allow_inefficient=True ao " "construtor" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "Os pinos 21+ não são suportados pelo ULP" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Os pinos devem ser sequenciais" @@ -4441,6 +4447,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 "Pins 21+ not supported from ULP" +#~ msgstr "Os pinos 21+ não são suportados pelo ULP" + #~ msgid "Unable to write" #~ msgstr "Não é possível escrever" diff --git a/locale/ru.po b/locale/ru.po index 08470eda78..ef30a149d8 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 4.15.1-dev\n" #: main.c @@ -75,6 +75,11 @@ msgstr "%%c требует int или char" msgid "%02X" msgstr "%02X" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -499,6 +504,11 @@ msgstr "Уже запущен" msgid "Already scanning for wifi networks" msgstr "Поиск сетей wifi уже происходит" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Другой PWMAudioOut уже активен" @@ -1820,10 +1830,6 @@ msgstr "" "%d байт. Если этого нельзя избежать, передайте allow_inefficient=True в " "конструктор" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Пины должны быть последовательными" diff --git a/locale/sv.po b/locale/sv.po index 1ad79178d7..c0ed44de29 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -72,6 +72,11 @@ msgstr "%%c kräver int eller char" msgid "%02X" msgstr "%02X" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -498,6 +503,11 @@ msgstr "Kör redan" msgid "Already scanning for wifi networks" msgstr "Skannar redan efter WiFi-nätverk" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "En annan PWMAudioOut är redan aktiv" @@ -1788,10 +1798,6 @@ msgstr "" "%d byte. Om detta inte kan undvikas, skicka allow_inefficient=True till " "konstruktorn" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "Pins 21+ stöds inte av ULP" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "Pinnarna måste vara i sekvens" @@ -4403,6 +4409,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 "Pins 21+ not supported from ULP" +#~ msgstr "Pins 21+ stöds inte av ULP" + #~ msgid "Unable to write" #~ msgstr "Kan inte skriva" diff --git a/locale/tr.po b/locale/tr.po index bafd72bd7e..56fe53b1eb 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -75,6 +75,11 @@ msgstr "%%c int veya char tipine ihtiyaç duyar" msgid "%02X" msgstr "%02X" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -501,6 +506,11 @@ msgstr "Halihazırda çalışıyor" msgid "Already scanning for wifi networks" msgstr "Halihazırda wifi ağları için tarama yapılıyor" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Başka bir PWMAudioOut zaten aktif durumda" @@ -1777,10 +1787,6 @@ msgid "" "constructor" msgstr "" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b89f9cd9b5..96ecd16539 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -74,6 +74,11 @@ msgstr "%%c xūyào zhěngshù huòzhě zìfú" msgid "%02X" msgstr "%02X" +#: shared-module/os/getenv.c +#, c-format +msgid "%S" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" @@ -500,6 +505,11 @@ msgstr "yǐjīng zài yùnxíng" msgid "Already scanning for wifi networks" msgstr "yǐjīng zài sǎomiáo WIFI wǎngluò" +#: shared-module/os/getenv.c +#, c-format +msgid "An error occurred while retrieving '%s':\n" +msgstr "" + #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "lìng yí gè PWMAudioOut yǐ jīng zài gōngzuò" @@ -1792,10 +1802,6 @@ msgstr "" "duōzì jié. Rúguǒ wúfǎ bìmiǎn, qǐng jiāng allow_inefficient = True chuándì " "gěigòuzào hánshù" -#: ports/espressif/common-hal/espulp/ULP.c -msgid "Pins 21+ not supported from ULP" -msgstr "" - #: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c msgid "Pins must be sequential" msgstr "yǐn jiǎo bì xū shì lián xù de" From d92cb154d61e65d5ef60d11db166b6de6534e077 Mon Sep 17 00:00:00 2001 From: Blinka CircuitPython Date: Tue, 27 Dec 2022 18:01:36 +0000 Subject: [PATCH 326/357] Translated using Weblate (Filipino) Currently translated at 33.4% (333 of 996 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fil/ --- locale/fil.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fil.po b/locale/fil.po index 51468a0a5b..a7acb9ea61 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -6,8 +6,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-08-23 14:19+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2022-12-27 18:02+0000\n" +"Last-Translator: Blinka CircuitPython \n" "Language-Team: fil\n" "Language: fil\n" "MIME-Version: 1.0\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1 && n != 2 && n != 3 && (n % 10 == 4 " "|| n % 10 == 6 || n % 10 == 9);\n" -"X-Generator: Weblate 4.8.1-dev\n" +"X-Generator: Weblate 4.15.1-dev\n" #: main.c msgid "" @@ -69,7 +69,7 @@ msgstr "" #: shared-module/os/getenv.c #, c-format msgid "%S" -msgstr "" +msgstr "%S" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format From 10640c9065239519fce5754dc924fabcc56592dc Mon Sep 17 00:00:00 2001 From: Blinka CircuitPython Date: Tue, 27 Dec 2022 18:01:39 +0000 Subject: [PATCH 327/357] Translated using Weblate (French) Currently translated at 97.0% (967 of 996 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index fa071b4f47..922ecbdbc4 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-11-09 19:20+0000\n" -"Last-Translator: Deleted User \n" +"PO-Revision-Date: 2022-12-27 18:02+0000\n" +"Last-Translator: Blinka CircuitPython \n" "Language: fr\n" "MIME-Version: 1.0\n" "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.15-dev\n" +"X-Generator: Weblate 4.15.1-dev\n" #: main.c msgid "" @@ -78,7 +78,7 @@ msgstr "%02X" #: shared-module/os/getenv.c #, c-format msgid "%S" -msgstr "" +msgstr "%S" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format From 2ad767ee4b318b15f63cd0552b0b2989ae843e01 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 27 Dec 2022 17:57:37 +0000 Subject: [PATCH 328/357] Translated using Weblate (Swedish) Currently translated at 100.0% (996 of 996 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index c0ed44de29..55f0c8efb5 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-12-22 15:49+0000\n" +"PO-Revision-Date: 2022-12-27 18:02+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -75,7 +75,7 @@ msgstr "%02X" #: shared-module/os/getenv.c #, c-format msgid "%S" -msgstr "" +msgstr "%S" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -506,7 +506,7 @@ msgstr "Skannar redan efter WiFi-nätverk" #: shared-module/os/getenv.c #, c-format msgid "An error occurred while retrieving '%s':\n" -msgstr "" +msgstr "Ett fel uppstod vid hämtning av '%s':\n" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" From ac3b46111b13f037efe358930432c4d6a86e6905 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 27 Dec 2022 19:16:00 +0100 Subject: [PATCH 329/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 4 ++++ locale/cs.po | 4 ++++ locale/de_DE.po | 4 ++++ locale/el.po | 4 ++++ locale/en_GB.po | 4 ++++ locale/es.po | 4 ++++ locale/fil.po | 4 ++++ locale/fr.po | 4 ++++ locale/hi.po | 4 ++++ locale/it_IT.po | 4 ++++ locale/ja.po | 4 ++++ locale/ko.po | 4 ++++ locale/nl.po | 4 ++++ locale/pl.po | 4 ++++ locale/pt_BR.po | 4 ++++ locale/ru.po | 4 ++++ locale/sv.po | 4 ++++ locale/tr.po | 4 ++++ locale/zh_Latn_pinyin.po | 4 ++++ 19 files changed, 76 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index ab5ea27d40..acb228ebea 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1418,6 +1418,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Nama terlalu panjang" diff --git a/locale/cs.po b/locale/cs.po index ce0b944057..cf7973d4ad 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1418,6 +1418,10 @@ msgstr "" msgid "NVS Error" msgstr "Chyba NVS" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Jméno je příliš dlouhé" diff --git a/locale/de_DE.po b/locale/de_DE.po index 1c751f839e..a72022c938 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1434,6 +1434,10 @@ msgstr "NLR-Sprung fehlgeschlagen. Mögliche Speicher-Beschädigung." msgid "NVS Error" msgstr "NVS-Fehler" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Name zu lang" diff --git a/locale/el.po b/locale/el.po index bc2d642ed9..246d49ad74 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1428,6 +1428,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 34d1dd5f2a..74c7efabf5 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -1419,6 +1419,10 @@ msgstr "NLR jump failed. Likely memory corruption." msgid "NVS Error" msgstr "NVS Error" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Name too long" diff --git a/locale/es.po b/locale/es.po index 558fc6ddf0..f39d4e2da5 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1441,6 +1441,10 @@ msgstr "Salto NLR falló. Probablemente corrupción de memoria." msgid "NVS Error" msgstr "Error NVS" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Nombre muy largo" diff --git a/locale/fil.po b/locale/fil.po index a7acb9ea61..6731d2d458 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1415,6 +1415,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 922ecbdbc4..908f93b553 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1460,6 +1460,10 @@ msgstr "Saut NLR échoué. Corruption de mémoire probable." msgid "NVS Error" msgstr "Erreur NVS" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Nom trop long" diff --git a/locale/hi.po b/locale/hi.po index bc22a63370..6e55808443 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1403,6 +1403,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 51d4cf1088..73ed787bf8 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1421,6 +1421,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 49e00a558d..b2227cecab 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1414,6 +1414,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "名前が長すぎます" diff --git a/locale/ko.po b/locale/ko.po index c0629fa452..8e7fee3e2f 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1406,6 +1406,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index f7d3237aad..728285da8e 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1414,6 +1414,10 @@ msgstr "" msgid "NVS Error" msgstr "NVS-fout" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Naam te lang" diff --git a/locale/pl.po b/locale/pl.po index 9e496f8d26..ba505d4e6b 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1414,6 +1414,10 @@ msgstr "" msgid "NVS Error" msgstr "" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Za długa nazwa" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 933a066371..693f2d1b9b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1442,6 +1442,10 @@ msgstr "O salto NLR falhou. Possível corrupção da memória." msgid "NVS Error" msgstr "Erro NVS" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Nome muito longo" diff --git a/locale/ru.po b/locale/ru.po index ef30a149d8..8152dcc694 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -1456,6 +1456,10 @@ msgstr "Не удалось выполнить NLR jump. Вероятно, по msgid "NVS Error" msgstr "Ошибка NVS" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Имя слишком длинное" diff --git a/locale/sv.po b/locale/sv.po index 55f0c8efb5..6038267ddd 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1427,6 +1427,10 @@ msgstr "NLR jump misslyckades. Troligen korrupt minne." msgid "NVS Error" msgstr "NVS-fel" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Name är för långt" diff --git a/locale/tr.po b/locale/tr.po index 56fe53b1eb..e7ed5b06bf 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -1426,6 +1426,10 @@ msgstr "" msgid "NVS Error" msgstr "NVS hatası" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "İsim çok uzun" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 96ecd16539..088a006c44 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1433,6 +1433,10 @@ msgstr "NLR tiào zhuǎn shī bài. kě néng shì nèi cún sǔn huài." msgid "NVS Error" msgstr "NVS cuò wù" +#: shared-bindings/socketpool/SocketPool.c +msgid "Name or service not known" +msgstr "" + #: py/qstr.c msgid "Name too long" msgstr "Míngchēng tài zhǎng" From 7a40d449e6bca4fd88a336627e94c79b0602e00f Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Tue, 27 Dec 2022 22:07:54 -0500 Subject: [PATCH 330/357] mimxrt10xx/common-hal/UART.C: Fix for bits parameter validation. I believe this will resolve issue #7389 --- ports/mimxrt10xx/common-hal/busio/UART.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 20430c91c8..871d57648d 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -113,7 +113,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, bool sigint_enabled) { self->baudrate = baudrate; - self->character_bits = (uint8_t)mp_arg_validate_int_range(self->character_bits, 7, 8, MP_QSTR_bits); + self->character_bits = (uint8_t)mp_arg_validate_int_range(bits, 7, 8, MP_QSTR_bits); self->timeout_ms = timeout * 1000; From 373db7897821bc3e7453c900a75c7df0136259f3 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 27 Dec 2022 22:16:14 +0000 Subject: [PATCH 331/357] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (997 of 997 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 693f2d1b9b..63a7cda056 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-12-22 15:49+0000\n" +"PO-Revision-Date: 2022-12-28 03:47+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -509,7 +509,7 @@ msgstr "Já está em busca das redes de wifi" #: shared-module/os/getenv.c #, c-format msgid "An error occurred while retrieving '%s':\n" -msgstr "" +msgstr "Ocorreu um erro ao recuperar '%s':\n" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" @@ -1444,7 +1444,7 @@ msgstr "Erro NVS" #: shared-bindings/socketpool/SocketPool.c msgid "Name or service not known" -msgstr "" +msgstr "Nome ou serviço desconhecido" #: py/qstr.c msgid "Name too long" From e62e9bd4af038e616478e95e68f672c07f8a6078 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 27 Dec 2022 18:58:19 +0000 Subject: [PATCH 332/357] Translated using Weblate (Swedish) Currently translated at 100.0% (997 of 997 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 6038267ddd..1a2079f605 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-12-27 18:02+0000\n" +"PO-Revision-Date: 2022-12-28 03:47+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1429,7 +1429,7 @@ msgstr "NVS-fel" #: shared-bindings/socketpool/SocketPool.c msgid "Name or service not known" -msgstr "" +msgstr "Namn eller tjänst inte känd" #: py/qstr.c msgid "Name too long" From a932fb3fb13391019338b47717204ea11715e1ea Mon Sep 17 00:00:00 2001 From: chukwon <51104273+chukwon@users.noreply.github.com> Date: Wed, 28 Dec 2022 21:25:25 +0800 Subject: [PATCH 333/357] Update pins.c also match lolin_c3_mini pins definition of new version --- ports/espressif/boards/lolin_c3_mini/pins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c index ccc70f6043..6b16020205 100644 --- a/ports/espressif/boards/lolin_c3_mini/pins.c +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -46,6 +46,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, From edcb83266113e93465ec0ea17c00de555101db7a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 28 Dec 2022 12:35:48 -0600 Subject: [PATCH 334/357] These need to be double-blackslashed --- tests/circuitpython/getenv.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/circuitpython/getenv.py b/tests/circuitpython/getenv.py index 2dccb99f97..e58af0e8e4 100644 --- a/tests/circuitpython/getenv.py +++ b/tests/circuitpython/getenv.py @@ -39,11 +39,11 @@ content_good = b""" # comment key0 = "hello world" key1 = 7 -key2= "\n" -key3 ="\u00c1x" -key4 = "\U000000c1x" -key5 = "\f\"\\" -key6 = "\t\r\b" +key2= "\\n" +key3 ="\\u00c1x" +key4 = "\\U000000c1x" +key5 = "\\f\\"\\\\" +key6 = "\\t\\r\\b" key7 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" key8 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" key9 = "hello comment" # comment From 83bbfd1815ed65031ad9b6eb805af3f2640876fc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 28 Dec 2022 12:36:58 -0600 Subject: [PATCH 335/357] Allow the tests to directly call the non-heap using _int and _str variants .. of getenv. These can have their own special bugs. --- ports/unix/modos.c | 30 ++++++++++++++++++++++++++++++ ports/unix/moduos_vfs.c | 8 ++++++++ tests/circuitpython/getenv.py | 3 +++ 3 files changed, 41 insertions(+) diff --git a/ports/unix/modos.c b/ports/unix/modos.c index 6bed69c43a..a6365aa6a3 100644 --- a/ports/unix/modos.c +++ b/ports/unix/modos.c @@ -57,7 +57,11 @@ #endif #if defined(MICROPY_UNIX_COVERAGE) +#include "py/objstr.h" +typedef int os_getenv_err_t; mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_); +os_getenv_err_t common_hal_os_getenv_str(const char *key, char *value, size_t value_len); +os_getenv_err_t common_hal_os_getenv_int(const char *key, mp_int_t *value); #endif STATIC mp_obj_t mod_os_urandom(mp_obj_t num) { @@ -212,6 +216,28 @@ STATIC mp_obj_t mod_os_getenv(mp_obj_t var_in) { } MP_DEFINE_CONST_FUN_OBJ_1(mod_os_getenv_obj, mod_os_getenv); +#if defined(MICROPY_UNIX_COVERAGE) +STATIC mp_obj_t mod_os_getenv_int(mp_obj_t var_in) { + mp_int_t value; + os_getenv_err_t result = common_hal_os_getenv_int(mp_obj_str_get_str(var_in), &value); + if (result == 0) { + return mp_obj_new_int(value); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(mod_os_getenv_int_obj, mod_os_getenv_int); + +STATIC mp_obj_t mod_os_getenv_str(mp_obj_t var_in) { + char buf[4096]; + os_getenv_err_t result = common_hal_os_getenv_str(mp_obj_str_get_str(var_in), buf, sizeof(buf)); + if (result == 0) { + return mp_obj_new_str_copy(&mp_type_str, (byte *)buf, strlen(buf)); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(mod_os_getenv_str_obj, mod_os_getenv_str); +#endif + STATIC mp_obj_t mod_os_putenv(mp_obj_t key_in, mp_obj_t value_in) { const char *key = mp_obj_str_get_str(key_in); const char *value = mp_obj_str_get_str(value_in); @@ -351,6 +377,10 @@ STATIC const mp_rom_map_elem_t mp_module_os_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_rename), MP_ROM_PTR(&mod_os_rename_obj) }, { MP_ROM_QSTR(MP_QSTR_rmdir), MP_ROM_PTR(&mod_os_rmdir_obj) }, { MP_ROM_QSTR(MP_QSTR_getenv), MP_ROM_PTR(&mod_os_getenv_obj) }, + #if defined(MICROPY_UNIX_COVERAGE) + { MP_ROM_QSTR(MP_QSTR_getenv_int), MP_ROM_PTR(&mod_os_getenv_int_obj) }, + { MP_ROM_QSTR(MP_QSTR_getenv_str), MP_ROM_PTR(&mod_os_getenv_str_obj) }, + #endif { MP_ROM_QSTR(MP_QSTR_putenv), MP_ROM_PTR(&mod_os_putenv_obj) }, { MP_ROM_QSTR(MP_QSTR_unsetenv), MP_ROM_PTR(&mod_os_unsetenv_obj) }, { MP_ROM_QSTR(MP_QSTR_mkdir), MP_ROM_PTR(&mod_os_mkdir_obj) }, diff --git a/ports/unix/moduos_vfs.c b/ports/unix/moduos_vfs.c index 41273bc7e2..495679290a 100644 --- a/ports/unix/moduos_vfs.c +++ b/ports/unix/moduos_vfs.c @@ -37,6 +37,10 @@ // These are defined in modos.c MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mod_os_errno_obj); MP_DECLARE_CONST_FUN_OBJ_1(mod_os_getenv_obj); +#if defined(MICROPY_UNIX_COVERAGE) +MP_DECLARE_CONST_FUN_OBJ_1(mod_os_getenv_int_obj); +MP_DECLARE_CONST_FUN_OBJ_1(mod_os_getenv_str_obj); +#endif MP_DECLARE_CONST_FUN_OBJ_1(mod_os_putenv_obj); MP_DECLARE_CONST_FUN_OBJ_1(mod_os_unsetenv_obj); MP_DECLARE_CONST_FUN_OBJ_1(mod_os_system_obj); @@ -47,6 +51,10 @@ STATIC const mp_rom_map_elem_t uos_vfs_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_errno), MP_ROM_PTR(&mod_os_errno_obj) }, { MP_ROM_QSTR(MP_QSTR_getenv), MP_ROM_PTR(&mod_os_getenv_obj) }, + #if defined(MICROPY_UNIX_COVERAGE) + { MP_ROM_QSTR(MP_QSTR_getenv_int), MP_ROM_PTR(&mod_os_getenv_int_obj) }, + { MP_ROM_QSTR(MP_QSTR_getenv_str), MP_ROM_PTR(&mod_os_getenv_str_obj) }, + #endif { MP_ROM_QSTR(MP_QSTR_putenv), MP_ROM_PTR(&mod_os_putenv_obj) }, { MP_ROM_QSTR(MP_QSTR_unsetenv), MP_ROM_PTR(&mod_os_unsetenv_obj) }, { MP_ROM_QSTR(MP_QSTR_system), MP_ROM_PTR(&mod_os_system_obj) }, diff --git a/tests/circuitpython/getenv.py b/tests/circuitpython/getenv.py index e58af0e8e4..68dd328cfb 100644 --- a/tests/circuitpython/getenv.py +++ b/tests/circuitpython/getenv.py @@ -79,6 +79,9 @@ content_good = content_good.replace(b"\n", b"\r\n") for i in range(13): run_test(f"key{i}", content_good) +run_test(f"K", b"K = 7\r\n") +print(uos.getenv_int("K")) + # Test value without trailing newline run_test(f"noeol", b"noeol=3") From 15a24b400d1a96f11083d14017016ee2955eebc9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 28 Dec 2022 12:37:27 -0600 Subject: [PATCH 336/357] Permit trailing whitespace in getenv_int --- shared-module/os/getenv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index 21a97f3fec..aac87e9ee6 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -413,6 +413,9 @@ STATIC os_getenv_err_t common_hal_os_getenv_int_inner(const char *key, mp_int_t } char *end; long num = strtol(buf, &end, 0); + while (unichar_isspace(*end)) { + end++; + } if (end == buf || *end) { // If the whole buffer was not consumed it's an error return GETENV_ERR_UNEXPECTED | *end; } From 2c46e785f669686100ebc6b2190f1d90379277ad Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 28 Dec 2022 12:38:07 -0600 Subject: [PATCH 337/357] update test results --- tests/circuitpython/getenv.py.exp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/circuitpython/getenv.py.exp b/tests/circuitpython/getenv.py.exp index 91c96e601a..ba1b1b3f90 100644 --- a/tests/circuitpython/getenv.py.exp +++ b/tests/circuitpython/getenv.py.exp @@ -1,9 +1,9 @@ key0 'hello world' key1 7 -key2 Invalid byte '\n' +key2 '\n' key3 'Áx' key4 'Áx' -key5 Invalid byte '\\' +key5 '\x0c"\\' key6 '\t\r\x08' key7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' key8 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' @@ -13,10 +13,10 @@ key11 0 key12 None key0 'hello world' key1 7 -key2 Invalid byte '\n' +key2 '\n' key3 'Áx' key4 'Áx' -key5 Invalid byte '\\' +key5 '\x0c"\\' key6 '\t\r\x08' key7 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' key8 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' @@ -24,6 +24,8 @@ key9 'hello comment' key10 127 key11 0 key12 None +K 7 +7 noeol 3 key Invalid byte '\n' key Invalid byte '"' From 7a005aa96b509441fe29fff57541e6d7be61afbb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 28 Dec 2022 13:22:36 -0600 Subject: [PATCH 338/357] break out after reading the value This is a small optimization, it avoids reading the full file when an early key is requested. In the case of an *invalid* TOML file such as ``` K=80 K=81 ``` this stops the value of K actually returned being 8081 and makes it 80 instead; but as it's a malformed file it doesn't really matter much. --- shared-module/os/getenv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index aac87e9ee6..870973c5d2 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -292,6 +292,7 @@ STATIC os_getenv_err_t os_getenv_vstr(const char *path, const char *key, vstr_t while (!is_eof(&active_file)) { if (key_matches(&active_file, key)) { result = read_value(&active_file, buf, quoted); + break; } } close_file(&active_file); From 3d6f37722636c97ee8540c4f536703ac047d523e Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 28 Dec 2022 18:36:25 -0500 Subject: [PATCH 339/357] Fix single quote in ru.po --- locale/ru.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/ru.po b/locale/ru.po index 8152dcc694..3d7f536335 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -173,7 +173,7 @@ msgstr "%q должно быть >= %d" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "%q должно быть bytearray или array типа ‘H' или 'B'" +msgstr "%q должно быть bytearray или array типа 'H' или 'B'" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" From cc92ce4820aebb4a1db93828f42a0ed7e97205ce Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 29 Dec 2022 19:49:40 -0500 Subject: [PATCH 340/357] Use memory fence when disabling cache to avoid -O2 problems --- ports/atmel-samd/peripherals | 2 +- ports/nrf/peripherals/nrf/cache.c | 10 ++++++++++ .../shared/external_flash/external_flash.c | 16 +++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 57133eefeb..baca4c0843 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 57133eefeb077f73b5ac17ee044d9feaf566da8e +Subproject commit baca4c084334aa8625f525a4032d66a397199ea6 diff --git a/ports/nrf/peripherals/nrf/cache.c b/ports/nrf/peripherals/nrf/cache.c index 6eb590d770..54bb77980b 100644 --- a/ports/nrf/peripherals/nrf/cache.c +++ b/ports/nrf/peripherals/nrf/cache.c @@ -29,8 +29,18 @@ // Turn off cache and invalidate all data in it. void nrf_peripherals_disable_and_clear_cache(void) { + // Memory fence for hardware and compiler reasons. If this routine is inlined, the compiler + // needs to know that everything written out be stored before this is called. + // -O2 optimization needed this on SAMD51. Assuming nRF may have the same issue. + // __sync_synchronize() includes volatile asm(), which tells the compiler not to assume + // state across this call. + __sync_synchronize(); + // Disabling cache also invalidates all cache entries. NRF_NVMC->ICACHECNF &= ~(1 << NVMC_ICACHECNF_CACHEEN_Pos); + + // Memory fence for hardware and compiler reasons. + __sync_synchronize(); } // Enable cache diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 7da45fdc99..141ad7e5f8 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -58,6 +58,9 @@ static supervisor_allocation *supervisor_cache = NULL; // Wait until both the write enable and write in progress bits have cleared. static bool wait_for_flash_ready(void) { + if (flash_device == NULL) { + return false; + } bool ok = true; // Both the write enable and write in progress bits should be low. if (flash_device->no_ready_bit) { @@ -192,6 +195,9 @@ static bool copy_block(uint32_t src_address, uint32_t dest_address) { return true; } +#define READ_JEDEC_ID_RETRY_COUNT (100) + +// If this fails, flash_device will remain NULL. void supervisor_flash_init(void) { if (flash_device != NULL) { return; @@ -220,7 +226,11 @@ void supervisor_flash_init(void) { #else // The response will be 0xff if the flash needs more time to start up. uint8_t jedec_id_response[3] = {0xff, 0xff, 0xff}; - while (jedec_id_response[0] == 0xff) { + // Response can also be 0x00 if reading before ready. When compiled with `-O2`, typically + // takes three tries to read on Grand Central M4. + + size_t count = READ_JEDEC_ID_RETRY_COUNT; + while ((count-- > 0) && (jedec_id_response[0] == 0xff || jedec_id_response[2] == 0x00)) { spi_flash_read_command(CMD_READ_JEDEC_ID, jedec_id_response, 3); } for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { @@ -234,6 +244,7 @@ void supervisor_flash_init(void) { } #endif if (flash_device == NULL) { + // Flash did not respond. Give up. return; } @@ -293,6 +304,9 @@ uint32_t supervisor_flash_get_block_size(void) { // The total number of available blocks. uint32_t supervisor_flash_get_block_count(void) { + if (flash_device == NULL) { + return 0; + } // We subtract one erase sector size because we may use it as a staging area // for writes. return (flash_device->total_size - SPI_FLASH_ERASE_SIZE) / FILESYSTEM_BLOCK_SIZE; From 42195a4a2990e48c4f360e32511d0c42fbfbe6b8 Mon Sep 17 00:00:00 2001 From: CDario Date: Fri, 30 Dec 2022 17:37:37 +0000 Subject: [PATCH 341/357] Added M5Stack Atom Matrix board --- .../boards/m5stack_atom_matrix/board.c | 29 +++++++++++ .../m5stack_atom_matrix/mpconfigboard.h | 49 ++++++++++++++++++ .../m5stack_atom_matrix/mpconfigboard.mk | 10 ++++ .../boards/m5stack_atom_matrix/pins.c | 51 +++++++++++++++++++ .../boards/m5stack_atom_matrix/sdkconfig | 27 ++++++++++ 5 files changed, 166 insertions(+) create mode 100644 ports/espressif/boards/m5stack_atom_matrix/board.c create mode 100644 ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h create mode 100644 ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.mk create mode 100644 ports/espressif/boards/m5stack_atom_matrix/pins.c create mode 100644 ports/espressif/boards/m5stack_atom_matrix/sdkconfig diff --git a/ports/espressif/boards/m5stack_atom_matrix/board.c b/ports/espressif/boards/m5stack_atom_matrix/board.c new file mode 100644 index 0000000000..c0d9676d86 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_matrix/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 CDarius + * + * 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h new file mode 100644 index 0000000000..926b7efbc4 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 CDarius + * + * 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 "M5Stack Atom Matrix" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO27) + +#define CIRCUITPY_BOARD_I2C (2) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO21, .sda = &pin_GPIO25}, \ + {.scl = &pin_GPIO32, .sda = &pin_GPIO26}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO23, .mosi = &pin_GPIO19, .miso = &pin_GPIO33}} + +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO39) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("The central button was pressed at start up.\n") + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.mk b/ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.mk new file mode 100644 index 0000000000..c34fa9d836 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0x10151015 +CIRCUITPY_CREATION_ID = 0x00320004 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/m5stack_atom_matrix/pins.c b/ports/espressif/boards/m5stack_atom_matrix/pins.c new file mode 100644 index 0000000000..9b18b954f0 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_matrix/pins.c @@ -0,0 +1,51 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +CIRCUITPY_BOARD_BUS_SINGLETON(porta_i2c, i2c, 1) + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, left side, then right side + + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A33), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_A25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SDA), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SCL), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_IR_LED), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/m5stack_atom_matrix/sdkconfig b/ports/espressif/boards/m5stack_atom_matrix/sdkconfig new file mode 100644 index 0000000000..a6678556eb --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_matrix/sdkconfig @@ -0,0 +1,27 @@ +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_SPIRAM_SUPPORT=n + +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="M5StaskAtomMatrix" +# end of LWIP + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings From 52ee5a92725a6f9780ef6d572b7433ff163d2c97 Mon Sep 17 00:00:00 2001 From: CDario Date: Fri, 30 Dec 2022 20:21:00 +0000 Subject: [PATCH 342/357] Added M5Stack Atom Echo --- .../boards/m5stack_atom_echo/board.c | 29 ++++++++++++ .../boards/m5stack_atom_echo/mpconfigboard.h | 46 +++++++++++++++++++ .../boards/m5stack_atom_echo/mpconfigboard.mk | 10 ++++ .../espressif/boards/m5stack_atom_echo/pins.c | 43 +++++++++++++++++ .../boards/m5stack_atom_echo/sdkconfig | 27 +++++++++++ 5 files changed, 155 insertions(+) create mode 100644 ports/espressif/boards/m5stack_atom_echo/board.c create mode 100644 ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h create mode 100644 ports/espressif/boards/m5stack_atom_echo/mpconfigboard.mk create mode 100644 ports/espressif/boards/m5stack_atom_echo/pins.c create mode 100644 ports/espressif/boards/m5stack_atom_echo/sdkconfig diff --git a/ports/espressif/boards/m5stack_atom_echo/board.c b/ports/espressif/boards/m5stack_atom_echo/board.c new file mode 100644 index 0000000000..c0d9676d86 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_echo/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 CDarius + * + * 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h new file mode 100644 index 0000000000..25eaec1e52 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h @@ -0,0 +1,46 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 CDarius + * + * 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 "M5Stack Atom Echo" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO27) + +#define CIRCUITPY_BOARD_I2C (2) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO21, .sda = &pin_GPIO25}, \ + {.scl = &pin_GPIO32, .sda = &pin_GPIO26}} + +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO39) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("The central button was pressed at start up.\n") + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.mk b/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.mk new file mode 100644 index 0000000000..663ceaad81 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0x10151015 +CIRCUITPY_CREATION_ID = 0x00320005 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/m5stack_atom_echo/pins.c b/ports/espressif/boards/m5stack_atom_echo/pins.c new file mode 100644 index 0000000000..d070414fe5 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_echo/pins.c @@ -0,0 +1,43 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +CIRCUITPY_BOARD_BUS_SINGLETON(porta_i2c, i2c, 1) + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, left side, then right side + + { MP_ROM_QSTR(MP_QSTR_I2S_SDO), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SDI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_I2S_LRC), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_A25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SDA), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SCL), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_IR_LED), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/m5stack_atom_echo/sdkconfig b/ports/espressif/boards/m5stack_atom_echo/sdkconfig new file mode 100644 index 0000000000..c6a1fcbabf --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_echo/sdkconfig @@ -0,0 +1,27 @@ +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_SPIRAM_SUPPORT=n + +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="M5StaskAtomEcho" +# end of LWIP + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings From 58e32bd2cb9a492aeb7163a9ac8964434738a3ed Mon Sep 17 00:00:00 2001 From: CDario Date: Fri, 30 Dec 2022 23:09:38 +0000 Subject: [PATCH 343/357] Fixed speacker and microphone pins definition --- ports/espressif/boards/m5stack_atom_echo/pins.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/espressif/boards/m5stack_atom_echo/pins.c b/ports/espressif/boards/m5stack_atom_echo/pins.c index d070414fe5..2b8044f07e 100644 --- a/ports/espressif/boards/m5stack_atom_echo/pins.c +++ b/ports/espressif/boards/m5stack_atom_echo/pins.c @@ -8,10 +8,13 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // External pins are in silkscreen order, from top to bottom, left side, then right side - { MP_ROM_QSTR(MP_QSTR_I2S_SDO), MP_ROM_PTR(&pin_GPIO22) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_GPIO19) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SDI), MP_ROM_PTR(&pin_GPIO23) }, - { MP_ROM_QSTR(MP_QSTR_I2S_LRC), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_SPK_I2S_SDO), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_SPK_I2S_SCK), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_SPK_I2S_LRC), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_PDM_MIC_CLK), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_PDM_MIC_DATA), MP_ROM_PTR(&pin_GPIO23) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, From dec0b272fec849d02285524654c316a8ee6a25a6 Mon Sep 17 00:00:00 2001 From: CDario Date: Fri, 30 Dec 2022 23:21:46 +0000 Subject: [PATCH 344/357] Fixed I2C bus definition --- ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h | 5 ++--- ports/espressif/boards/m5stack_atom_echo/pins.c | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h index 25eaec1e52..7d67267897 100644 --- a/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h +++ b/ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h @@ -31,9 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO27) -#define CIRCUITPY_BOARD_I2C (2) -#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO21, .sda = &pin_GPIO25}, \ - {.scl = &pin_GPIO32, .sda = &pin_GPIO26}} +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO32, .sda = &pin_GPIO26}} // For entering safe mode #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO39) diff --git a/ports/espressif/boards/m5stack_atom_echo/pins.c b/ports/espressif/boards/m5stack_atom_echo/pins.c index 2b8044f07e..68b6389215 100644 --- a/ports/espressif/boards/m5stack_atom_echo/pins.c +++ b/ports/espressif/boards/m5stack_atom_echo/pins.c @@ -1,8 +1,6 @@ #include "shared-bindings/board/__init__.h" #include "shared-module/displayio/__init__.h" -CIRCUITPY_BOARD_BUS_SINGLETON(porta_i2c, i2c, 1) - STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS @@ -39,8 +37,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IR_LED), MP_ROM_PTR(&pin_GPIO12) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 4fe00ef74a4225f2d80eebf6b79e69f7fe41ca4d Mon Sep 17 00:00:00 2001 From: CDario Date: Sat, 31 Dec 2022 06:21:49 +0000 Subject: [PATCH 345/357] Added M5Stack Atom U --- ports/espressif/boards/m5stack_atom_u/board.c | 29 +++++++++++ .../boards/m5stack_atom_u/mpconfigboard.h | 48 +++++++++++++++++++ .../boards/m5stack_atom_u/mpconfigboard.mk | 10 ++++ ports/espressif/boards/m5stack_atom_u/pins.c | 42 ++++++++++++++++ .../espressif/boards/m5stack_atom_u/sdkconfig | 27 +++++++++++ 5 files changed, 156 insertions(+) create mode 100644 ports/espressif/boards/m5stack_atom_u/board.c create mode 100644 ports/espressif/boards/m5stack_atom_u/mpconfigboard.h create mode 100644 ports/espressif/boards/m5stack_atom_u/mpconfigboard.mk create mode 100644 ports/espressif/boards/m5stack_atom_u/pins.c create mode 100644 ports/espressif/boards/m5stack_atom_u/sdkconfig diff --git a/ports/espressif/boards/m5stack_atom_u/board.c b/ports/espressif/boards/m5stack_atom_u/board.c new file mode 100644 index 0000000000..c0d9676d86 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_u/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 CDarius + * + * 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" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/m5stack_atom_u/mpconfigboard.h b/ports/espressif/boards/m5stack_atom_u/mpconfigboard.h new file mode 100644 index 0000000000..b3b0a650ab --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_u/mpconfigboard.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 CDarius + * + * 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 "M5Stack Atom U" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO27) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO32, .sda = &pin_GPIO26}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO23, .mosi = &pin_GPIO19, .miso = &pin_GPIO33}} + +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO39) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("The central button was pressed at start up.\n") + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/m5stack_atom_u/mpconfigboard.mk b/ports/espressif/boards/m5stack_atom_u/mpconfigboard.mk new file mode 100644 index 0000000000..18bb6d3dc0 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_u/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0x10151015 +CIRCUITPY_CREATION_ID = 0x00320006 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/m5stack_atom_u/pins.c b/ports/espressif/boards/m5stack_atom_u/pins.c new file mode 100644 index 0000000000..4ba62ae2b7 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_u/pins.c @@ -0,0 +1,42 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, left side, then right side + + { MP_ROM_QSTR(MP_QSTR_A25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A33), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SDA), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SCL), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_IR_LED), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_PDM_MIC_CLK), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_PDM_MIC_DATA), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/m5stack_atom_u/sdkconfig b/ports/espressif/boards/m5stack_atom_u/sdkconfig new file mode 100644 index 0000000000..7f405b00e0 --- /dev/null +++ b/ports/espressif/boards/m5stack_atom_u/sdkconfig @@ -0,0 +1,27 @@ +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_SPIRAM_SUPPORT=n + +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="M5StaskAtomU" +# end of LWIP + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings From 91d28c7623da8520c2c12abfe8049d443ed20cc7 Mon Sep 17 00:00:00 2001 From: Orlando Caro Date: Fri, 30 Dec 2022 15:58:04 +0000 Subject: [PATCH 346/357] Translated using Weblate (Spanish) Currently translated at 85.8% (856 of 997 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 79 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/locale/es.po b/locale/es.po index f39d4e2da5..5b8e3b5883 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-09-23 17:20+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2022-12-31 17:50+0000\n" +"Last-Translator: Orlando Caro \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "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.14.1\n" +"X-Generator: Weblate 4.15.1-dev\n" #: main.c msgid "" @@ -97,9 +97,8 @@ msgstr "" #: ports/raspberrypi/common-hal/analogio/AnalogOut.c #: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c #: ports/stm/common-hal/rtc/RTC.c -#, fuzzy msgid "%q" -msgstr "%q" +msgstr "" #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" @@ -134,7 +133,7 @@ msgstr "%q inicializado fallido" #: shared-bindings/dualbank/__init__.c msgid "%q is %q" -msgstr "" +msgstr "%q es %q" #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" @@ -174,27 +173,27 @@ msgstr "%q debe ser >= %d" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q debe ser un byte-matriz o matriz de tipo 'H' o 'B'" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" -msgstr "" +msgstr "%q debe ser un byte-matriz o matriz de tipo 'h', 'H', 'b', o 'B'" #: py/argcheck.c py/obj.c py/objstrunicode.c msgid "%q must be of type %q" -msgstr "" +msgstr "%q debe ser de typo %q" #: py/objexcept.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" -msgstr "" +msgstr "%q debe ser de tipo %q o None" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" -msgstr "" +msgstr "%q debe ser potencia de 2" #: shared-bindings/wifi/Monitor.c msgid "%q out of bounds" -msgstr "" +msgstr "%q fuera de limites" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -211,7 +210,7 @@ msgstr "pin inválido %q" #: py/objrange.c py/objslice.c shared-bindings/random/__init__.c msgid "%q step cannot be zero" -msgstr "" +msgstr "%q paso no puede ser cero" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -219,11 +218,11 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" #: shared-bindings/usb_hid/Device.c msgid "%q, %q, and %q must all be the same length" -msgstr "" +msgstr "%q, %q, y %q deben tener el mismo largo" #: py/objint.c shared-bindings/storage/__init__.c msgid "%q=%q" -msgstr "" +msgstr "%q=%q" #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format @@ -412,7 +411,7 @@ msgstr "La dirección debe tener %d bytes de largo" #: ports/espressif/common-hal/memorymap/AddressRange.c msgid "Address range not allowed" -msgstr "" +msgstr "Rango de dirección no permitido" #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" @@ -510,7 +509,7 @@ msgstr "Ya se están buscando redes wifi" #: shared-module/os/getenv.c #, c-format msgid "An error occurred while retrieving '%s':\n" -msgstr "" +msgstr "Un error ocurrió mientras recuperaba '%s':\n" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" @@ -541,7 +540,7 @@ msgstr "Asignación del montículo mientras la VM no esta ejecutándose." #: ports/raspberrypi/audio_dma.c msgid "Audio conversion not implemented" -msgstr "" +msgstr "Conversión de audio no esta implementada" #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" @@ -586,11 +585,12 @@ msgstr "Bits depth debe ser múltiplo de 8." #: shared-bindings/bitmaptools/__init__.c msgid "Bitmap size and bits per value must match" -msgstr "" +msgstr "El tamaño del mapa de bits y los bits por valor deben cotejar" #: supervisor/shared/safe_mode.c msgid "Boot device must be first device (interface #0)." msgstr "" +"El dispositivo de arranque debe de ser el primer dispositivo (interfase #0)." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -601,7 +601,7 @@ msgstr "Ambos RX y TX requeridos para control de flujo" #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "Both buttons were pressed at start up.\n" -msgstr "" +msgstr "Ambos botones fueron prensados al inicio\n" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -631,17 +631,17 @@ msgstr "" #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "Buffer no es un bytearray." +msgstr "Búfer no es un bytearray." #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "El buffer es muy pequeño" +msgstr "Búfer es muy pequeño" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "Longitud del buffer %d es demasiado grande. Tiene que ser menor a %d" +msgstr "Longitud del búfer %d es demasiado grande. Tiene que ser menor a %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c @@ -655,11 +655,11 @@ msgstr "Búfer deber ser un múltiplo de 512 bytes" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Búffer muy corto por %d bytes" +msgstr "Búfer muy corto por %d bytes" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "Buffers must be same size" -msgstr "" +msgstr "Búferes deben ser del mismo tamaño" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c @@ -672,7 +672,7 @@ msgstr "Bus pin %d ya está siendo utilizado" #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h msgid "Button A was pressed at start up.\n" -msgstr "" +msgstr "Botón A fue presionado al inicio.\n" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." @@ -683,8 +683,9 @@ msgid "CBC blocks must be multiples of 16 bytes" msgstr "Los bloques CBC deben ser múltiplos de 16 bytes" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "CIRCUITPY drive could not be found or created." -msgstr "" +msgstr "CIRCUITPY dispositivo de guardo no pudo ser encontrado o creado." #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" @@ -696,7 +697,7 @@ msgstr "Llame a super().__init__() antes de acceder al objeto nativo." #: ports/cxd56/common-hal/camera/Camera.c msgid "Camera init" -msgstr "" +msgstr "Inicialización de cámara" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." @@ -4256,7 +4257,7 @@ msgstr "nombre en unicode escapa" #: py/parse.c msgid "unindent doesn't match any outer indent level" -msgstr "" +msgstr "unindent no coteja ningún nivel de espacio exterior" #: py/objstr.c #, c-format @@ -4278,7 +4279,7 @@ msgstr "tipo desconocido '%q'" #: py/objstr.c #, c-format msgid "unmatched '%c' in format" -msgstr "" +msgstr "no coteja '%c' en formato" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4300,11 +4301,11 @@ msgstr "instrucción Xtensa '%s' con %d argumentos no soportada" #: shared-module/gifio/GifWriter.c msgid "unsupported colorspace for GifWriter" -msgstr "" +msgstr "espacio de color no soportado para GifWriter" #: shared-bindings/bitmaptools/__init__.c msgid "unsupported colorspace for dither" -msgstr "" +msgstr "espacio de color no soportado para tramado" #: py/objstr.c #, c-format @@ -4325,11 +4326,11 @@ msgstr "tipos no soportados para %q: '%q', '%q'" #: extmod/ulab/code/numpy/io/io.c msgid "usecols is too high" -msgstr "" +msgstr "usecols es muy alto" #: extmod/ulab/code/numpy/io/io.c msgid "usecols keyword must be specified" -msgstr "" +msgstr "usecols palabra clave debe de ser especificada" #: py/objint.c #, c-format @@ -4338,7 +4339,7 @@ msgstr "el valor debe caber en %d byte(s)" #: shared-bindings/bitmaptools/__init__.c msgid "value out of range of target" -msgstr "" +msgstr "valor fuera de alcance al blanco" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" @@ -4359,7 +4360,7 @@ msgstr "wifi no esta habilitado" #: ports/raspberrypi/common-hal/wifi/Monitor.c msgid "wifi.Monitor not available" -msgstr "" +msgstr "wifi.Monitor no esta disponible" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" @@ -4375,7 +4376,7 @@ msgstr "eje especificado erróneo" #: extmod/ulab/code/numpy/io/io.c msgid "wrong dtype" -msgstr "" +msgstr "erroneo dtype" #: extmod/ulab/code/numpy/transform.c msgid "wrong index type" @@ -4389,11 +4390,11 @@ msgstr "tipo de entrada incorrecta" #: extmod/ulab/code/numpy/transform.c msgid "wrong length of condition array" -msgstr "" +msgstr "largo erroneo en el arreglo de condiciones" #: extmod/ulab/code/numpy/transform.c msgid "wrong length of index array" -msgstr "" +msgstr "largo erroneo en el arreglo de índices" #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" From d2361ae4f9029a6b2a3093788f9786d70fcca2a0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 1 Jan 2023 16:39:52 -0600 Subject: [PATCH 347/357] Avoid an undefined shift (1 << 32), an operation on a signed 32-bit int, is undefined in C. The operation on the unsigned int (1u<<32) is defined as zero, which is the desired outcome (subtracting 1 yields the value with all bits set) This problem was detected by clang scan-build static analysis --- shared-module/displayio/Bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 676aec2186..ab1b85ea16 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -70,8 +70,8 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, self->x_shift++; power_of_two <<= 1; } - self->x_mask = (1 << self->x_shift) - 1; // Used as a modulus on the x value - self->bitmask = (1 << bits_per_value) - 1; + self->x_mask = (1u << self->x_shift) - 1u; // Used as a modulus on the x value + self->bitmask = (1u << bits_per_value) - 1u; self->dirty_area.x1 = 0; self->dirty_area.x2 = width; From d8081857444496b8849a8a910ef0fda771f1cfce Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 1 Jan 2023 16:40:06 -0600 Subject: [PATCH 348/357] Emphasize that ALIGN_BITS is a constant --- shared-module/displayio/Bitmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index ab1b85ea16..7a1b3e6b17 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -30,12 +30,12 @@ #include "py/runtime.h" -enum { align_bits = 8 * sizeof(uint32_t) }; +enum { ALIGN_BITS = 8 * sizeof(uint32_t) }; static int stride(uint32_t width, uint32_t bits_per_value) { uint32_t row_width = width * bits_per_value; // align to uint32_t - return (row_width + align_bits - 1) / align_bits; + return (row_width + ALIGN_BITS - 1) / ALIGN_BITS; } void common_hal_displayio_bitmap_construct(displayio_bitmap_t *self, uint32_t width, @@ -66,7 +66,7 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, self->x_shift = 0; // Used to divide the index by the number of pixels per word. Its used in a // shift which effectively divides by 2 ** x_shift. uint32_t power_of_two = 1; - while (power_of_two < align_bits / bits_per_value) { + while (power_of_two < ALIGN_BITS / bits_per_value) { self->x_shift++; power_of_two <<= 1; } From 34043c2d38c9e9c52fbcee8fe487099098eab927 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 1 Jan 2023 16:44:12 -0600 Subject: [PATCH 349/357] Only store up to 'width' pixels, not 'stride' error detected by clang scan-build static analysis --- shared-module/bitmaptools/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/bitmaptools/__init__.c b/shared-module/bitmaptools/__init__.c index 4c73d8fb8e..67b5254b32 100644 --- a/shared-module/bitmaptools/__init__.c +++ b/shared-module/bitmaptools/__init__.c @@ -689,7 +689,7 @@ STATIC void fill_row(displayio_bitmap_t *bitmap, int swap, int16_t *luminance_da static void write_pixels(displayio_bitmap_t *bitmap, int y, bool *data) { if (bitmap->bits_per_value == 1) { uint32_t *pixel_data = (uint32_t *)(bitmap->data + bitmap->stride * y); - for (int i = 0; i < bitmap->stride; i++) { + for (int i = 0; i < bitmap->width; i++) { uint32_t p = 0; for (int j = 0; j < 32; j++) { p = (p << 1); From ef8b297d7f6e04818370de2fe3409823f45b9d02 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 1 Jan 2023 16:56:46 -0600 Subject: [PATCH 350/357] Avoid null pointer dereference when no kwargs clang scan-build reports "Access to field 'table' results in a dereference of a null pointer (loaded from variable 'kw_args')" --- py/objtype.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py/objtype.c b/py/objtype.c index 0914ad5f2e..76b9551be8 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -106,7 +106,9 @@ STATIC mp_obj_t native_base_init_wrapper(size_t n_args, const mp_obj_t *pos_args // copy in args memcpy(args2, pos_args, n_args * sizeof(mp_obj_t)); // copy in kwargs - memcpy(args2 + n_args, kw_args->table, 2 * n_kw * sizeof(mp_obj_t)); + if (n_kw) { + memcpy(args2 + n_args, kw_args->table, 2 * n_kw * sizeof(mp_obj_t)); + } self->subobj[0] = native_base->make_new(native_base, n_args, n_kw, args2); m_del(mp_obj_t, args2, n_args + 2 * n_kw); From a3adcf0e1a7b984fd73fd911d09b2370e48eb159 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 19 Dec 2022 10:44:06 -0500 Subject: [PATCH 351/357] clarify read-only mac address; reuse translate msgs --- locale/circuitpython.pot | 17 +++++++---------- ports/espressif/esp32-camera | 2 +- ports/raspberrypi/common-hal/wifi/Radio.c | 4 ++-- shared-bindings/microcontroller/Processor.c | 2 +- shared-module/displayio/Bitmap.c | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 57ba9766be..3878310429 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -124,6 +124,11 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +#: shared-bindings/microcontroller/Processor.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -298,7 +303,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "" @@ -1856,7 +1861,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "" @@ -1864,10 +1869,6 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -3071,10 +3072,6 @@ msgstr "" msgid "format requires a dict" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "" diff --git a/ports/espressif/esp32-camera b/ports/espressif/esp32-camera index 4ff7f348d0..54c3f61c86 160000 --- a/ports/espressif/esp32-camera +++ b/ports/espressif/esp32-camera @@ -1 +1 @@ -Subproject commit 4ff7f348d0713ea8eca022f73a059b0fe0934531 +Subproject commit 54c3f61c864c3d3ffd779042454554045b9dd9d2 diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index 4cd80fb4b7..db21dd333b 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -64,8 +64,8 @@ static inline void nw_put_le32(uint8_t *buf, uint32_t x) { buf[3] = x >> 24; } -NORETURN static void ro_attribute(int attr) { - mp_raise_msg_varg(&mp_type_AttributeError, MP_ERROR_TEXT("'%s' object has no attribute '%q'"), "Radio", attr); +NORETURN static void ro_attribute(qstr attr) { + mp_raise_NotImplementedError_varg(translate("%q is read-only for this board"), attr); } bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) { diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index 3b671d0c7b..2479638a92 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -72,7 +72,7 @@ STATIC mp_obj_t mcu_processor_set_frequency(mp_obj_t self, mp_obj_t freq) { uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 0, MP_QSTR_frequency); common_hal_mcu_processor_set_frequency(self, value_of_freq); #else - mp_raise_msg(&mp_type_NotImplementedError,translate("frequency is read-only for this board")); + mp_raise_NotImplementedError_varg(translate("%q is read-only for this board"), MP_QSTR_frequency); #endif return mp_const_none; } diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 7a1b3e6b17..6c64830dce 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -117,7 +117,7 @@ uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *self, int16_t void displayio_bitmap_set_dirty_area(displayio_bitmap_t *self, const displayio_area_t *dirty_area) { if (self->read_only) { - mp_raise_RuntimeError(translate("Read-only object")); + mp_raise_RuntimeError(translate("Read-only")); } displayio_area_t area = *dirty_area; From 2da4e06890aa081670ea4da92cca7099f51a4e5b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 19 Dec 2022 11:08:35 -0500 Subject: [PATCH 352/357] fix up esp32-camera submodule --- .gitmodules | 1 + ports/espressif/esp32-camera | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 3c0128f77d..dfd718630c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -310,6 +310,7 @@ [submodule "ports/espressif/esp32-camera"] path = ports/espressif/esp32-camera url = https://github.com/adafruit/esp32-camera/ + branch = circuitpython [submodule "ports/raspberrypi/lib/cyw43-driver"] path = ports/raspberrypi/lib/cyw43-driver url = https://github.com/adafruit/cyw43-driver.git diff --git a/ports/espressif/esp32-camera b/ports/espressif/esp32-camera index 54c3f61c86..4ff7f348d0 160000 --- a/ports/espressif/esp32-camera +++ b/ports/espressif/esp32-camera @@ -1 +1 @@ -Subproject commit 54c3f61c864c3d3ffd779042454554045b9dd9d2 +Subproject commit 4ff7f348d0713ea8eca022f73a059b0fe0934531 From 01f6762aa1110bf489f39ec0ed2589a277dd78ca Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 2 Jan 2023 10:40:49 -0500 Subject: [PATCH 353/357] Update ports/espressif/boards/m5stack_atom_u/sdkconfig --- ports/espressif/boards/m5stack_atom_u/sdkconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/espressif/boards/m5stack_atom_u/sdkconfig b/ports/espressif/boards/m5stack_atom_u/sdkconfig index 7f405b00e0..90c99459a8 100644 --- a/ports/espressif/boards/m5stack_atom_u/sdkconfig +++ b/ports/espressif/boards/m5stack_atom_u/sdkconfig @@ -1,4 +1,3 @@ -CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y CONFIG_ESP32_SPIRAM_SUPPORT=n # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set From f5c0996fb7c292ead6d0c86a84cbf8495104690b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 2 Jan 2023 10:41:11 -0500 Subject: [PATCH 354/357] Update ports/espressif/boards/m5stack_atom_echo/sdkconfig --- ports/espressif/boards/m5stack_atom_echo/sdkconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/espressif/boards/m5stack_atom_echo/sdkconfig b/ports/espressif/boards/m5stack_atom_echo/sdkconfig index c6a1fcbabf..3879222bab 100644 --- a/ports/espressif/boards/m5stack_atom_echo/sdkconfig +++ b/ports/espressif/boards/m5stack_atom_echo/sdkconfig @@ -1,4 +1,3 @@ -CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y CONFIG_ESP32_SPIRAM_SUPPORT=n # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set From a061729dccc367c9e8cb386e3f9b67681f7546ec Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 2 Jan 2023 10:41:25 -0500 Subject: [PATCH 355/357] Update ports/espressif/boards/m5stack_atom_matrix/sdkconfig --- ports/espressif/boards/m5stack_atom_matrix/sdkconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/espressif/boards/m5stack_atom_matrix/sdkconfig b/ports/espressif/boards/m5stack_atom_matrix/sdkconfig index a6678556eb..474a760b56 100644 --- a/ports/espressif/boards/m5stack_atom_matrix/sdkconfig +++ b/ports/espressif/boards/m5stack_atom_matrix/sdkconfig @@ -1,4 +1,3 @@ -CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y CONFIG_ESP32_SPIRAM_SUPPORT=n # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set From 03b43b7b3f59225d6c67d18b75dc0a87190c235a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 2 Jan 2023 11:45:58 -0500 Subject: [PATCH 356/357] complete rework for microcontroller.cpu.frequency and wifi.radio MAC addresses --- locale/circuitpython.pot | 5 +++- ports/raspberrypi/mpconfigport.mk | 3 +++ py/circuitpy_mpconfig.mk | 3 +++ py/runtime.c | 4 ++-- shared-bindings/microcontroller/Processor.c | 17 ++++++++++---- shared-bindings/wifi/Radio.c | 26 +++++++++++++++++++-- 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3878310429..7546dfa0c6 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -125,7 +125,6 @@ msgid "%q is %q" msgstr "" #: ports/raspberrypi/common-hal/wifi/Radio.c -#: shared-bindings/microcontroller/Processor.c msgid "%q is read-only for this board" msgstr "" @@ -2711,6 +2710,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index fa1f0c153d..c5de2a439d 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -2,6 +2,9 @@ LONGINT_IMPL = MPZ CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1 +# CYW43 support does not provide settable MAC addresses for station or AP. +CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS = 0 + CIRCUITPY_ALARM ?= 1 CIRCUITPY_RP2PIO ?= 1 diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 01b078c6e8..3c1c173a51 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -538,6 +538,9 @@ CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) CIRCUITPY_WEB_WORKFLOW ?= $(CIRCUITPY_WIFI) CFLAGS += -DCIRCUITPY_WEB_WORKFLOW=$(CIRCUITPY_WEB_WORKFLOW) +CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS?= 1 +CFLAGS += -DCIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS=$(CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS) + # tinyusb port tailored configuration CIRCUITPY_TUSB_MEM_ALIGN ?= 4 CFLAGS += -DCIRCUITPY_TUSB_MEM_ALIGN=$(CIRCUITPY_TUSB_MEM_ALIGN) diff --git a/py/runtime.c b/py/runtime.c index 6be5c22335..9779456d0c 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1247,8 +1247,8 @@ void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) { mp_raise_AttributeError(MP_ERROR_TEXT("no such attribute")); #else mp_raise_msg_varg(&mp_type_AttributeError, - MP_ERROR_TEXT("'%s' object has no attribute '%q'"), - mp_obj_get_type_str(base), attr); + MP_ERROR_TEXT("can't set attribute '%q'"), + attr); #endif } diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index 2479638a92..986f81ea53 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -65,19 +65,21 @@ //| ... //| frequency: int -//| """The CPU operating frequency in Hertz. (read-only)""" +//| """The CPU operating frequency in Hertz. +//| +//| **Limitations:** Setting the ``frequency`` is possible only on some i.MX boards. +//| On most boards, ``frequency`` is read-only. +//| """ +#if CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY STATIC mp_obj_t mcu_processor_set_frequency(mp_obj_t self, mp_obj_t freq) { - #if CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 0, MP_QSTR_frequency); common_hal_mcu_processor_set_frequency(self, value_of_freq); - #else - mp_raise_NotImplementedError_varg(translate("%q is read-only for this board"), MP_QSTR_frequency); - #endif return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(mcu_processor_set_frequency_obj, mcu_processor_set_frequency); +#endif STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) { @@ -86,9 +88,14 @@ STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) { MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_frequency_obj, mcu_processor_get_frequency); +#if CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY MP_PROPERTY_GETSET(mcu_processor_frequency_obj, (mp_obj_t)&mcu_processor_get_frequency_obj, (mp_obj_t)&mcu_processor_set_frequency_obj); +#else +MP_PROPERTY_GETTER(mcu_processor_frequency_obj, + (mp_obj_t)&mcu_processor_get_frequency_obj); +#endif //| reset_reason: microcontroller.ResetReason //| """The reason the microcontroller started up from reset state.""" diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index c12e19e726..27a5907894 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -139,13 +139,19 @@ MP_PROPERTY_GETSET(wifi_radio_hostname_obj, //| mac_address: ReadableBuffer //| """MAC address for the station. When the address is altered after interface is connected -//| the changes would only be reflected once the interface reconnects.""" +//| the changes would only be reflected once the interface reconnects. +//| +//| **Limitations:** Not settable on RP2040 CYW43 boards, such as Pi Pico W. +//| """ + + STATIC mp_obj_t _wifi_radio_get_mac_address(mp_obj_t self_in) { wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); return MP_OBJ_FROM_PTR(common_hal_wifi_radio_get_mac_address(self)); } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_mac_address_obj, _wifi_radio_get_mac_address); +#if CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS STATIC mp_obj_t wifi_radio_set_mac_address(mp_obj_t self_in, mp_obj_t mac_address_in) { mp_buffer_info_t mac_address; mp_get_buffer_raise(mac_address_in, &mac_address, MP_BUFFER_READ); @@ -160,10 +166,16 @@ STATIC mp_obj_t wifi_radio_set_mac_address(mp_obj_t self_in, mp_obj_t mac_addres return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_mac_address_obj, wifi_radio_set_mac_address); +#endif +#if CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS MP_PROPERTY_GETSET(wifi_radio_mac_address_obj, (mp_obj_t)&wifi_radio_get_mac_address_obj, (mp_obj_t)&wifi_radio_set_mac_address_obj); +#else +MP_PROPERTY_GETTER(wifi_radio_mac_address_obj, + (mp_obj_t)&wifi_radio_get_mac_address_obj); +#endif //| tx_power: float //| """Wifi transmission power, in dBm.""" @@ -187,13 +199,17 @@ MP_PROPERTY_GETSET(wifi_radio_tx_power_obj, //| mac_address_ap: ReadableBuffer //| """MAC address for the AP. When the address is altered after interface is started -//| the changes would only be reflected once the interface restarts.""" +//| the changes would only be reflected once the interface restarts. +//| +//| **Limitations:** Not settable on RP2040 CYW43 boards, such as Pi Pico W. +//| """ STATIC mp_obj_t wifi_radio_get_mac_address_ap(mp_obj_t self_in) { wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); return MP_OBJ_FROM_PTR(common_hal_wifi_radio_get_mac_address_ap(self)); } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_mac_address_ap_obj, wifi_radio_get_mac_address_ap); +#if CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS STATIC mp_obj_t wifi_radio_set_mac_address_ap(mp_obj_t self_in, mp_obj_t mac_address_in) { mp_buffer_info_t mac_address; mp_get_buffer_raise(mac_address_in, &mac_address, MP_BUFFER_READ); @@ -208,10 +224,16 @@ STATIC mp_obj_t wifi_radio_set_mac_address_ap(mp_obj_t self_in, mp_obj_t mac_add return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_mac_address_ap_obj, wifi_radio_set_mac_address_ap); +#endif +#if CIRCUITPY_WIFI_RADIO_SETTABLE_MAC_ADDRESS MP_PROPERTY_GETSET(wifi_radio_mac_address_ap_obj, (mp_obj_t)&wifi_radio_get_mac_address_ap_obj, (mp_obj_t)&wifi_radio_set_mac_address_ap_obj); +#else +MP_PROPERTY_GETTER(wifi_radio_mac_address_ap_obj, + (mp_obj_t)&wifi_radio_get_mac_address_ap_obj); +#endif //| def start_scanning_networks( //| self, *, start_channel: int = 1, stop_channel: int = 11 From 86e2a2440153c4b8a135f8a89619c15c9609ff7b Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 2 Jan 2023 19:23:35 +0100 Subject: [PATCH 357/357] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 23 +++++++++++++---------- locale/cs.po | 20 ++++++++++---------- locale/de_DE.po | 26 ++++++++++++++++---------- locale/el.po | 20 ++++++++++---------- locale/en_GB.po | 23 +++++++++++++---------- locale/es.po | 23 +++++++++++++---------- locale/fil.po | 25 ++++++++++++++----------- locale/fr.po | 26 ++++++++++++++++---------- locale/hi.po | 20 ++++++++++---------- locale/it_IT.po | 25 ++++++++++++++----------- locale/ja.po | 23 +++++++++++++---------- locale/ko.po | 20 ++++++++++---------- locale/nl.po | 23 +++++++++++++---------- locale/pl.po | 23 +++++++++++++---------- locale/pt_BR.po | 26 ++++++++++++++++---------- locale/ru.po | 20 ++++++++++---------- locale/sv.po | 26 ++++++++++++++++---------- locale/tr.po | 20 ++++++++++---------- locale/zh_Latn_pinyin.po | 26 ++++++++++++++++---------- 19 files changed, 246 insertions(+), 192 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index acb228ebea..9f1e185dff 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -130,6 +130,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -304,7 +308,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "Objek '%s' tidak memiliki atribut '%q'" @@ -1883,7 +1887,7 @@ msgid "Random number generation error" msgstr "Kesalahan pembuatan nomor acak" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Baca-saja" @@ -1891,10 +1895,6 @@ msgstr "Baca-saja" msgid "Read-only filesystem" msgstr "sistem file (filesystem) bersifat Read-only" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Objek Read-only" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2741,6 +2741,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" @@ -3102,10 +3106,6 @@ msgstr "" msgid "format requires a dict" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "" @@ -4378,6 +4378,9 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "Read-only object" +#~ msgstr "Objek Read-only" + #~ msgid "%q length must be >= 1" #~ msgstr "%q panjang harus >= 1" diff --git a/locale/cs.po b/locale/cs.po index cf7973d4ad..b73fe1df88 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -131,6 +131,10 @@ msgstr "Inicializace %q selhala" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "Délka %q musí být %d" @@ -305,7 +309,7 @@ msgstr "'%s' objekt nepodporuje přiřazení položky" msgid "'%s' object doesn't support item deletion" msgstr "'%s' objekt nepodporuje smazání položky" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' objekt nemá žádný atribut '%q'" @@ -1874,7 +1878,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "" @@ -1882,10 +1886,6 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2728,6 +2728,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" @@ -3089,10 +3093,6 @@ msgstr "" msgid "format requires a dict" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index a72022c938..69d2e6ee36 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -132,6 +132,10 @@ msgstr "%q Initialisierung ist gescheitert" msgid "%q is %q" msgstr "%q ist %q" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q länge muss %d betragen" @@ -308,7 +312,7 @@ msgstr "'%s' Objekt unterstützt keine Element-Zuordnung" msgid "'%s' object doesn't support item deletion" msgstr "'%s' Objekt unterstützt keine Löschung von Elementen" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' Objekt hat kein Attribut '%q'" @@ -1899,7 +1903,7 @@ msgid "Random number generation error" msgstr "Fehler bei der Erzeugung von Zufallszahlen" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Nur lesen möglich, da Schreibgeschützt" @@ -1907,10 +1911,6 @@ msgstr "Nur lesen möglich, da Schreibgeschützt" msgid "Read-only filesystem" msgstr "Schreibgeschützte Dateisystem" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Schreibgeschützte Objekt" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Erhaltene Antwort ist ungültig" @@ -2787,6 +2787,10 @@ msgstr "Kann Blockgröße von 512 nicht setzen" msgid "can't set attribute" msgstr "kann Attribut nicht setzen" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "Speichern von '%q' nicht möglich" @@ -3158,10 +3162,6 @@ msgstr "Die Schriftart (font) muss 2048 Byte lang sein" msgid "format requires a dict" msgstr "Format erfordert ein Wörterbuch (dict)" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "Frequenz ist für dieses Board schreibgeschützt" - #: py/objdeque.c msgid "full" msgstr "voll" @@ -4448,6 +4448,12 @@ 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 "Read-only object" +#~ msgstr "Schreibgeschützte Objekt" + +#~ msgid "frequency is read-only for this board" +#~ msgstr "Frequenz ist für dieses Board schreibgeschützt" + #~ msgid "Unable to write" #~ msgstr "Schreiben nicht möglich" diff --git a/locale/el.po b/locale/el.po index 246d49ad74..fe882c9f30 100644 --- a/locale/el.po +++ b/locale/el.po @@ -136,6 +136,10 @@ msgstr "%q εκκίνηση απέτυχε" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q μήκος πρέπει να είναι %d" @@ -310,7 +314,7 @@ msgstr "'%s' αντικείμενο δεν υποστηρίζει ορισμό msgid "'%s' object doesn't support item deletion" msgstr "'%s' αντικείμενο δεν υποστηρίζει διαγραφή πράγματος" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' αντικείμενο δεν έχει γνώρισμα '%q'" @@ -1883,7 +1887,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "" @@ -1891,10 +1895,6 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2737,6 +2737,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" @@ -3098,10 +3102,6 @@ msgstr "" msgid "format requires a dict" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 74c7efabf5..6bb13d2570 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -134,6 +134,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -308,7 +312,7 @@ msgstr "'%s' object doesn't support item assignment" msgid "'%s' object doesn't support item deletion" msgstr "'%s' object doesn't support item deletion" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' object has no attribute '%q'" @@ -1880,7 +1884,7 @@ msgid "Random number generation error" msgstr "Random number generation error" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Read-only" @@ -1888,10 +1892,6 @@ msgstr "Read-only" msgid "Read-only filesystem" msgstr "Read-only filesystem" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Read-only object" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Received response was invalid" @@ -2744,6 +2744,10 @@ msgstr "can't set 512 block size" msgid "can't set attribute" msgstr "can't set attribute" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "can't store '%q'" @@ -3108,10 +3112,6 @@ msgstr "font must be 2048 bytes long" msgid "format requires a dict" msgstr "format requires a dict" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "full" @@ -4383,6 +4383,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 "Read-only object" +#~ msgstr "Read-only object" + #~ msgid "%q length must be >= 1" #~ msgstr "%q length must be >= 1" diff --git a/locale/es.po b/locale/es.po index 5b8e3b5883..f65f60a770 100644 --- a/locale/es.po +++ b/locale/es.po @@ -135,6 +135,10 @@ msgstr "%q inicializado fallido" msgid "%q is %q" msgstr "%q es %q" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q tamaño debe ser %d" @@ -309,7 +313,7 @@ msgstr "'%s' el objeto no tiene capacidad de asignación de item" msgid "'%s' object doesn't support item deletion" msgstr "'%s' el objeto no tiene capacidad de borrado de item" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "objeto '%s' no tiene atributo '%q'" @@ -1909,7 +1913,7 @@ msgid "Random number generation error" msgstr "Error de generación de números aleatorios" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Solo-lectura" @@ -1917,10 +1921,6 @@ msgstr "Solo-lectura" msgid "Read-only filesystem" msgstr "Sistema de archivos de solo-Lectura" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Objeto de solo-lectura" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "La respuesta recibida es invalida" @@ -2782,6 +2782,10 @@ msgstr "no se puede definir un tamaño de bloque de 512" msgid "can't set attribute" msgstr "no se puede asignar el atributo" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "no se puede almacenar '%q'" @@ -3149,10 +3153,6 @@ msgstr "font debe ser 2048 bytes de largo" msgid "format requires a dict" msgstr "format requiere un dict" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "lleno" @@ -4432,6 +4432,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 "Read-only object" +#~ msgstr "Objeto de solo-lectura" + #~ msgid "%q length must be >= 1" #~ msgstr "%q tamaño debe ser >= 1" diff --git a/locale/fil.po b/locale/fil.po index 6731d2d458..7a77dab021 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -125,6 +125,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -300,7 +304,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' object ay walang attribute '%q'" @@ -1872,7 +1876,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Basahin-lamang" @@ -1880,11 +1884,6 @@ msgstr "Basahin-lamang" msgid "Read-only filesystem" msgstr "Basahin-lamang mode" -#: shared-module/displayio/Bitmap.c -#, fuzzy -msgid "Read-only object" -msgstr "Basahin-lamang" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2732,6 +2731,10 @@ msgstr "" msgid "can't set attribute" msgstr "hindi ma i-set ang attribute" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "hindi ma i-store ang '%q'" @@ -3101,10 +3104,6 @@ msgstr "font ay dapat 2048 bytes ang haba" msgid "format requires a dict" msgstr "kailangan ng format ng dict" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "puno" @@ -4385,6 +4384,10 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#, fuzzy +#~ msgid "Read-only object" +#~ msgstr "Basahin-lamang" + #~ msgid "Invalid pins" #~ msgstr "Mali ang pins" diff --git a/locale/fr.po b/locale/fr.po index 908f93b553..910c11cf57 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -136,6 +136,10 @@ msgstr "échec de l'initialisation %q" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "La longeur de %q doit être %d" @@ -310,7 +314,7 @@ msgstr "l'objet %s ne supporte pas l'assignation d'éléments" msgid "'%s' object doesn't support item deletion" msgstr "L'objet '%s' ne prend pas en charge la suppression d'éléments" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "l'objet '%s' n'a pas d'attribut '%q'" @@ -1929,7 +1933,7 @@ msgid "Random number generation error" msgstr "Erreur de génération de chiffres aléatoires" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Lecture seule" @@ -1937,10 +1941,6 @@ msgstr "Lecture seule" msgid "Read-only filesystem" msgstr "Système de fichier en lecture seule" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Objet en lecture seule" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Réponse reçue invalide" @@ -2815,6 +2815,10 @@ msgstr "impossible de définir une taille de bloc de 512" msgid "can't set attribute" msgstr "attribut non modifiable" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "impossible de stocker '%q'" @@ -3188,10 +3192,6 @@ msgstr "la police doit être longue de 2048 octets" msgid "format requires a dict" msgstr "le format nécessite un dict" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "la fréquence est en lecture seule pour cette carte" - #: py/objdeque.c msgid "full" msgstr "plein" @@ -4476,6 +4476,12 @@ 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 "Read-only object" +#~ msgstr "Objet en lecture seule" + +#~ msgid "frequency is read-only for this board" +#~ msgstr "la fréquence est en lecture seule pour cette carte" + #~ msgid "Unable to write" #~ msgstr "Écriture impossible" diff --git a/locale/hi.po b/locale/hi.po index 6e55808443..6b43cffabc 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -124,6 +124,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -298,7 +302,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "" @@ -1856,7 +1860,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "" @@ -1864,10 +1868,6 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2710,6 +2710,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" @@ -3071,10 +3075,6 @@ msgstr "" msgid "format requires a dict" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 73ed787bf8..33c397da01 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -131,6 +131,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -305,7 +309,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "l'oggetto '%s' non ha l'attributo '%q'" @@ -1882,7 +1886,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Sola lettura" @@ -1890,11 +1894,6 @@ msgstr "Sola lettura" msgid "Read-only filesystem" msgstr "Filesystem in sola lettura" -#: shared-module/displayio/Bitmap.c -#, fuzzy -msgid "Read-only object" -msgstr "Sola lettura" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2743,6 +2742,10 @@ msgstr "" msgid "can't set attribute" msgstr "impossibile impostare attributo" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "impossibile memorizzare '%q'" @@ -3109,10 +3112,6 @@ msgstr "il font deve essere lungo 2048 byte" msgid "format requires a dict" msgstr "la formattazione richiede un dict" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "pieno" @@ -4398,6 +4397,10 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#, fuzzy +#~ msgid "Read-only object" +#~ msgstr "Sola lettura" + #~ msgid "At most %d %q may be specified (not %d)" #~ msgstr "Almeno %d %q devono essere specificati (non %d)" diff --git a/locale/ja.po b/locale/ja.po index b2227cecab..d7573c2197 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -129,6 +129,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -303,7 +307,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "" @@ -1869,7 +1873,7 @@ msgid "Random number generation error" msgstr "乱数生成エラー" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "読み込み専用" @@ -1877,10 +1881,6 @@ msgstr "読み込み専用" msgid "Read-only filesystem" msgstr "読み込み専用のファイルシステム" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "読み込み専用のオブジェクト" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2724,6 +2724,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" @@ -3089,10 +3093,6 @@ msgstr "fontは2048バイト長でなければなりません" msgid "format requires a dict" msgstr "formatにはdictが必要" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "" @@ -4367,6 +4367,9 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Read-only object" +#~ msgstr "読み込み専用のオブジェクト" + #~ msgid "At most %d %q may be specified (not %d)" #~ msgstr "最大で %d個の %q が指定できます(%d個でなく)" diff --git a/locale/ko.po b/locale/ko.po index 8e7fee3e2f..39ff657aff 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -125,6 +125,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -299,7 +303,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "" @@ -1859,7 +1863,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "" @@ -1867,10 +1871,6 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2714,6 +2714,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" @@ -3075,10 +3079,6 @@ msgstr "" msgid "format requires a dict" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "완전한(full)" diff --git a/locale/nl.po b/locale/nl.po index 728285da8e..79b6333de4 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -127,6 +127,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -301,7 +305,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' object heeft geen attribuut '%q'" @@ -1880,7 +1884,7 @@ msgid "Random number generation error" msgstr "Random number generatie fout" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Alleen-lezen" @@ -1888,10 +1892,6 @@ msgstr "Alleen-lezen" msgid "Read-only filesystem" msgstr "Alleen-lezen bestandssysteem" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Alleen-lezen object" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2741,6 +2741,10 @@ msgstr "kan geen 512 blokgrootte instellen" msgid "can't set attribute" msgstr "kan attribute niet instellen" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "kan '%q' niet opslaan" @@ -3104,10 +3108,6 @@ msgstr "lettertype moet 2048 bytes lang zijn" msgid "format requires a dict" msgstr "format vereist een dict" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "vol" @@ -4383,6 +4383,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 "Read-only object" +#~ msgstr "Alleen-lezen object" + #~ msgid "At most %d %q may be specified (not %d)" #~ msgstr "Op zijn meest %d %q mogen worden gespecificeerd (niet %d)" diff --git a/locale/pl.po b/locale/pl.po index ba505d4e6b..814a5d06d4 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -129,6 +129,10 @@ msgstr "" msgid "%q is %q" msgstr "" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "" @@ -303,7 +307,7 @@ msgstr "" msgid "'%s' object doesn't support item deletion" msgstr "" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' obiekt nie ma atrybutu '%q'" @@ -1867,7 +1871,7 @@ msgid "Random number generation error" msgstr "Błąd generowania liczb losowych" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Tylko do odczytu" @@ -1875,10 +1879,6 @@ msgstr "Tylko do odczytu" msgid "Read-only filesystem" msgstr "System plików tylko do odczytu" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Obiekt tylko do odczytu" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Otrzymana odpowiedź była nieprawidłowa" @@ -2721,6 +2721,10 @@ msgstr "" msgid "can't set attribute" msgstr "nie można ustawić atrybutu" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "nie można zapisać '%q'" @@ -3083,10 +3087,6 @@ msgstr "font musi mieć 2048 bajtów długości" msgid "format requires a dict" msgstr "format wymaga słownika" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "pełny" @@ -4359,6 +4359,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Read-only object" +#~ msgstr "Obiekt tylko do odczytu" + #~ msgid "Invalid pins" #~ msgstr "Złe nóżki" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 63a7cda056..b82aaf1ff9 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -133,6 +133,10 @@ msgstr "a inicialização do %q falhou" msgid "%q is %q" msgstr "%q é %q" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "O comprimento de %q deve ser %d" @@ -307,7 +311,7 @@ msgstr "O objeto '%s' não suporta a atribuição dos itens" msgid "'%s' object doesn't support item deletion" msgstr "O objeto '%s' não é compatível com exclusão do item" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "O objeto '%s' não possui o atributo '%q'" @@ -1912,7 +1916,7 @@ msgid "Random number generation error" msgstr "Houve um erro na geração do número aleatório" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Somente leitura" @@ -1920,10 +1924,6 @@ msgstr "Somente leitura" msgid "Read-only filesystem" msgstr "Sistema de arquivos somente leitura" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Objeto de leitura apenas" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "A resposta recebida foi inválida" @@ -2795,6 +2795,10 @@ msgstr "não é possível definir o tamanho de 512 blocos" msgid "can't set attribute" msgstr "não é possível definir o atributo" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "não é possível armazenar '%q'" @@ -3165,10 +3169,6 @@ msgstr "a fonte deve ter 2048 bytes de comprimento" msgid "format requires a dict" msgstr "formato requer um dict" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "nesta placa, a frequência é de apenas leitura" - #: py/objdeque.c msgid "full" msgstr "cheio" @@ -4451,6 +4451,12 @@ 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 "Read-only object" +#~ msgstr "Objeto de leitura apenas" + +#~ msgid "frequency is read-only for this board" +#~ msgstr "nesta placa, a frequência é de apenas leitura" + #~ msgid "Pins 21+ not supported from ULP" #~ msgstr "Os pinos 21+ não são suportados pelo ULP" diff --git a/locale/ru.po b/locale/ru.po index 3d7f536335..5549e7e3f9 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -135,6 +135,10 @@ msgstr "Инициализация %q не удалась" msgid "%q is %q" msgstr "%q является %q" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "Длинна %q должна быть %d" @@ -309,7 +313,7 @@ msgstr "Объект '%s' не поддерживает присвоение э msgid "'%s' object doesn't support item deletion" msgstr "Объект '%s' не поддерживает удаление элементов" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "Объект '%s' не имеет атрибута '%q'" @@ -1924,7 +1928,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "" @@ -1932,10 +1936,6 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2780,6 +2780,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" @@ -3141,10 +3145,6 @@ msgstr "" msgid "format requires a dict" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 1a2079f605..c64ff356c0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -132,6 +132,10 @@ msgstr "%q init misslyckades" msgid "%q is %q" msgstr "%q är %q" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "längden på %q måste vara %d" @@ -308,7 +312,7 @@ msgstr "Objektet '%s' stöder inte tilldelning" msgid "'%s' object doesn't support item deletion" msgstr "Objektet '%s' stöder inte borttagning" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "Objektet '%s' har inget attribut '%q'" @@ -1892,7 +1896,7 @@ msgid "Random number generation error" msgstr "Fel vid generering av slumptal" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Skrivskyddad" @@ -1900,10 +1904,6 @@ msgstr "Skrivskyddad" msgid "Read-only filesystem" msgstr "Skrivskyddat filsystem" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Skrivskyddat objekt" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Mottaget svar var ogiltigt" @@ -2766,6 +2766,10 @@ msgstr "kan inte sätta blockstorlek 512" msgid "can't set attribute" msgstr "kan inte att ange attribut" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "kan inte lagra '%q'" @@ -3134,10 +3138,6 @@ msgstr "typsnitt måste vara 2048 bytes långt" msgid "format requires a dict" msgstr "formatet kräver en dict" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "frekvens är skrivskyddad för detta kort" - #: py/objdeque.c msgid "full" msgstr "full" @@ -4413,6 +4413,12 @@ 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 "Read-only object" +#~ msgstr "Skrivskyddat objekt" + +#~ msgid "frequency is read-only for this board" +#~ msgstr "frekvens är skrivskyddad för detta kort" + #~ msgid "Pins 21+ not supported from ULP" #~ msgstr "Pins 21+ stöds inte av ULP" diff --git a/locale/tr.po b/locale/tr.po index e7ed5b06bf..e25e81d679 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -136,6 +136,10 @@ msgstr "%q init başarısız oldu" msgid "%q is %q" msgstr "%q %q dir" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q boyutu %d olmalıdır" @@ -310,7 +314,7 @@ msgstr "'%s' nesnesi, öğe atamasını desteklemiyor" msgid "'%s' object doesn't support item deletion" msgstr "'%s' nesnesi, öğe silmeyi desteklemiyor" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' nesnesinin '%q' özelliği yok" @@ -1882,7 +1886,7 @@ msgid "Random number generation error" msgstr "" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "" @@ -1890,10 +1894,6 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2736,6 +2736,10 @@ msgstr "" msgid "can't set attribute" msgstr "" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "" @@ -3097,10 +3101,6 @@ msgstr "" msgid "format requires a dict" msgstr "" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "" - #: py/objdeque.c msgid "full" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 088a006c44..8599c77f2e 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -135,6 +135,10 @@ msgstr "%q chūshǐhuà shībài" msgid "%q is %q" msgstr "%q shì %q" +#: ports/raspberrypi/common-hal/wifi/Radio.c +msgid "%q is read-only for this board" +msgstr "" + #: py/argcheck.c shared-bindings/usb_hid/Device.c msgid "%q length must be %d" msgstr "%q de chángdù bìxū shì %d" @@ -310,7 +314,7 @@ msgstr "'%s' duìxiàng bù zhīchí yuánsù fùzhí" msgid "'%s' object doesn't support item deletion" msgstr "'%s' duìxiàng bù zhīchí yuánsù shānchú" -#: ports/raspberrypi/common-hal/wifi/Radio.c py/runtime.c +#: py/runtime.c msgid "'%s' object has no attribute '%q'" msgstr "'%s' duìxiàng méiyǒu shǔxìng '%q'" @@ -1896,7 +1900,7 @@ msgid "Random number generation error" msgstr "Suíjī shù shēngchéng cuòwù" #: shared-bindings/memorymonitor/AllocationSize.c -#: shared-bindings/pulseio/PulseIn.c +#: shared-bindings/pulseio/PulseIn.c shared-module/displayio/Bitmap.c msgid "Read-only" msgstr "Zhǐ dú" @@ -1904,10 +1908,6 @@ msgstr "Zhǐ dú" msgid "Read-only filesystem" msgstr "Zhǐ dú wénjiàn xìtǒng" -#: shared-module/displayio/Bitmap.c -msgid "Read-only object" -msgstr "Zhǐ dú duìxiàng" - #: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "shōu dào de xiǎng yìng wú xiào" @@ -2771,6 +2771,10 @@ msgstr "wúfǎ shèzhì 512 kuài dàxiǎo" msgid "can't set attribute" msgstr "wúfǎ shèzhì shǔxìng" +#: py/runtime.c +msgid "can't set attribute '%q'" +msgstr "" + #: py/emitnative.c msgid "can't store '%q'" msgstr "wúfǎ cúnchú '%q'" @@ -3140,10 +3144,6 @@ msgstr "zìtǐ bìxū wèi 2048 zì jié" msgid "format requires a dict" msgstr "géshì yāoqiú yīgè yǔjù" -#: shared-bindings/microcontroller/Processor.c -msgid "frequency is read-only for this board" -msgstr "cǐ zhǔ bǎn de pín lǜ wéi zhǐ dú" - #: py/objdeque.c msgid "full" msgstr "chōngfèn" @@ -4419,6 +4419,12 @@ 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 "Read-only object" +#~ msgstr "Zhǐ dú duìxiàng" + +#~ msgid "frequency is read-only for this board" +#~ msgstr "cǐ zhǔ bǎn de pín lǜ wéi zhǐ dú" + #~ msgid "Unable to write" #~ msgstr "wú fǎ xiě rù"